-
Notifications
You must be signed in to change notification settings - Fork 100
[FIX] ctc_loss_op_test_gpu unit test suite failure #3083
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
base: r2.18-rocm-enhanced
Are you sure you want to change the base?
Conversation
0d3905b
to
c8301b6
Compare
c8301b6
to
1fce875
Compare
…sticTest.testForwardAndBackward due to the floating-point arithmetics for gfx11xx and gfx12xx. Implement test_util.gpu_gcn_arch() which returns the information on the current gcn architecture. Implement unit test for test_util.gpu_gcn_arch(). Modify GetShortDeviceDescription() in gpu_device.cc to return gcn arch as well.
1fce875
to
574fddb
Compare
@@ -1970,6 +1970,7 @@ static string GetShortDeviceDescription( | |||
#elif TENSORFLOW_USE_ROCM | |||
return strings::StrCat("device: ", platform_device_id.value(), | |||
", name: ", desc.name(), | |||
", gcn arch: ", desc.rocm_compute_capability().gcn_arch_name(), |
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.
Would it be better if we use the same key-value pairs as CUDA, though they return the same thing?
compute capability: desc.rocm_compute_capability().ToString()
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.
Here we return a specific part of the compute capability; therefore I've used getter specific for returning the gcn_arch_name.
Otherwise, if we inspect device_description.h we can observe that CudaComputeCapability has method ToString() that returns the version of the software in a format "major"."minor". Inspecting RocmComputeCapability we can see that there is no equivalent method in it. Nevertheless, it would not fit our needs. :)
@@ -189,6 +189,29 @@ def gpu_device_name() -> str: | |||
return compat.as_str(x.name) | |||
return "" | |||
|
|||
@tf_export("test.gpu_gcn_arch") |
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.
Does CUDA have the counterpart? What's the behavior if this API is called on the CUDA platform?
Should we add the rocm_
prefix here?
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.
If this method is called on a system with CUDA support, it will just return empty string, as the CUDA description is not the same as the the ROCm one.
We could be more descriptive with the name and detail design comment.
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.
LGTM
Motivation
The command
bazel test -s --config=rocm //tensorflow/python/kernel_tests/nn_ops:ctc_loss_op_test_gpu
will produce failure of CTCLossDeterministicTest.testForwardAndBackward on gfx11xx and gfx12xx. The failure occured due to one element that represents the difference between gradients is greater than the previous absolute tolerance.Log:
Technical Details
Increase the absolute tolerance between gradients in CTCLossDeterministicTest.testForwardAndBackward due to the floating-point arithmetic.