-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print CPU and GPU output when _assert_equal fails to help debug given… #2657
Print CPU and GPU output when _assert_equal fails to help debug given… #2657
Conversation
_assert_equal(cpu, gpu, float_check=get_float_check(), path=[]) | ||
except Exception as ex: | ||
print("CPU OUTPUT: %s \n\n GPU OUTPUT: %s" % (cpu, gpu)) | ||
raise ex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can re-raise the last exception with less boilerplate
try:
...
except:
...
raise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
try: | ||
_assert_equal(cpu, gpu, float_check=get_float_check(), path=[]) | ||
except Exception as ex: | ||
print("CPU OUTPUT: %s \n\n GPU OUTPUT: %s" % (cpu, gpu)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: multi-line f string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure if I understood this comment. But I split this into two print statements, please let me know if I misunderstood.
… the failed path Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
9725ff1
to
259a6a1
Compare
build |
1 similar comment
build |
_assert_equal(cpu, gpu, float_check=get_float_check(), path=[]) | ||
except: | ||
print("CPU OUTPUT: %s" % cpu) | ||
print("GPU OUTPUT: %s" % gpu) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: technically this is not guaranteed to be the output for the GPU or the CPU because we could have sorted it locally first, but I think everyone will understand and I think this is the right place to print out the info.
@abellina is this supposed to be 21.06? Should this be updated to 21.08? |
… the failed path
Signed-off-by: Alessandro Bellina abellina@nvidia.com
This seems like a simple way to capture the output of a test on failure, to help debug. One could take this output and them diff the cpu and the gpu, so one can match that with the "path", as already provided by the test framework on failure.
Re: #2477.