Skip to content

test(conv): silence the expected fp16 overflow in the cast kernel test - #16

Merged
AlexanderSoftCode merged 1 commit into
mainfrom
test/conv-cast-overflow-warning
Oct 30, 2026
Merged

AlexanderSoftCode merged 1 commit into
mainfrom
test/conv-cast-overflow-warning

Conversation

@AlexanderSoftCode

Copy link
Copy Markdown
Owner

Context

Every GPU run of the suite printed RuntimeWarning: overflow encountered in cast from tests/ops/test_conv_cast_kernel.py:55, on both the RTX 3050 and the RX 9070 XT. The overflow is intentional, and the warning came from the test's NumPy reference, not from aether. One commit, 94d765d, test-only.

Behavior changes

None

Testing

  • python3 -m unittest discover tests: 1142 tests pass on NumPy and CuPy (65 skipped). The overflow warning no longer appears.
  • python3 -W error::RuntimeWarning -m unittest tests.ops.test_conv_cast_kernel passes, so the cast test doesn't raise the warning anymore.
  • test_matches_clip_and_astype now asserts that some inputs exceed 65504, so the overflow half of the test can't quietly turn into an in-range check. The reference cast runs under np.errstate(over="ignore"), scoped to that one line, so the clipped dvalues path would still warn if it ever overflowed.
  • GPU: RX 9070 XT (gfx1201, ROCm), CuPy 14.2.

test_matches_clip_and_astype scales its inputs by 3e4 so some exceed
fp16's 65504; the backward cast leaves inputs unclipped, so they must
overflow to inf like forward's astype. The NumPy reference cast hit that
overflow on the host and printed "RuntimeWarning: overflow encountered
in cast" on every GPU run.

The reference cast now runs under np.errstate(over="ignore"), scoped to
that one line so the clipped dvalues path still warns if it ever
overflows. A new assert checks the inputs really exceed the fp16 range,
as the existing one does for dvalues, so the overflow half of the test
can't silently become an in-range check.
@AlexanderSoftCode
AlexanderSoftCode merged commit 49f8e9e into main Oct 30, 2026
5 checks passed
@AlexanderSoftCode
AlexanderSoftCode deleted the test/conv-cast-overflow-warning branch October 30, 2026 05:49
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.

1 participant