Skip to content

[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

Open
wants to merge 1 commit into
base: r2.18-rocm-enhanced
Choose a base branch
from

Conversation

AleksaArsic
Copy link

@AleksaArsic AleksaArsic commented Aug 12, 2025

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:

======================================================================
FAIL: testForwardAndBackward2 (True, False) (__main__.CTCLossDeterministicTest) [graph_mode]
CTCLossDeterministicTest.testForwardAndBackward2 (True, False)
testForwardAndBackward(True, False)
----------------------------------------------------------------------
...
Mismatched elements: 1 / 32000 (0.00313%)
Max absolute difference among violations: 7.075071e-05
Max relative difference among violations: 0.00036804
...
======================================================================
FAIL: testForwardAndBackward3 (True, True) (__main__.CTCLossDeterministicTest) [graph_mode]
CTCLossDeterministicTest.testForwardAndBackward3 (True, True)
testForwardAndBackward(True, True)
----------------------------------------------------------------------
...
Mismatched elements: 1 / 32000 (0.00313%)
Max absolute difference among violations: 5.2332878e-05
Max relative difference among violations: 0.00028655
...
----------------------------------------------------------------------

Technical Details

Increase the absolute tolerance between gradients in CTCLossDeterministicTest.testForwardAndBackward due to the floating-point arithmetic.

…sticTest.testForwardAndBackward due to the floating-point arithmetics.
@AleksaArsic AleksaArsic marked this pull request as ready for review August 12, 2025 15:46
@AleksaArsic AleksaArsic requested a review from i-chaochen August 12, 2025 15:46
i-chaochen

This comment was marked as duplicate.

self.assertAllClose(gradient_a, gradient_b, atol=5e-05)
# adding absolute tolerance to the difference of gradients due to the
# floating point arithmetics
self.assertAllClose(gradient_a, gradient_b, atol=1e-04)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this should only for navi?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants