Skip to content

[NFC] Limit the range of integers so that the sum does not overflow in reduce test case#7470

Merged
ThomasRaoux merged 3 commits intotriton-lang:mainfrom
chengjunlu:public/fix_test_reduce_overflow
Jul 11, 2025
Merged

[NFC] Limit the range of integers so that the sum does not overflow in reduce test case#7470
ThomasRaoux merged 3 commits intotriton-lang:mainfrom
chengjunlu:public/fix_test_reduce_overflow

Conversation

@chengjunlu
Copy link
Copy Markdown
Contributor

Our CI hit an overflow issue in reduce test case with Triton Interpreter.

FAILED language/test_core.py::test_reduce1d[4-1-1-sum-int32-32] - triton.runtime.errors.InterpreterError: InterpreterError("OverflowError('Python integer -4736833654 out of bounds for int32')")
FAILED language/test_core.py::test_reduce1d[4-1-1-sum-int32-64] - triton.runtime.errors.InterpreterError: InterpreterError("OverflowError('Python integer -17340316748 out of bounds for int32')")
FAILED language/test_core.py::test_reduce1d[4-1-1-sum-int32-128] - triton.runtime.errors.InterpreterError: InterpreterError("OverflowError('Python integer -15950412024 out of bounds for int32')")
FAILED language/test_core.py::test_reduce1d[4-1-1-sum-int32-512] - triton.runtime.errors.InterpreterError: InterpreterError("OverflowError('Python integer 6080852592 out of bounds for int32')")

There is a comment in the test_reduce1d about limiting the range of Integers in case overflow but without actual code.
Add the limitation as the comment.

@chengjunlu chengjunlu requested a review from ptillet as a code owner July 11, 2025 01:40
@chengjunlu
Copy link
Copy Markdown
Contributor Author

chengjunlu commented Jul 11, 2025

@Jokeren Can you please help to review the changes?

@ThomasRaoux
Copy link
Copy Markdown
Collaborator

looks like those tests still fail, not sure how it started

Comment thread python/test/unit/language/test_core.py Outdated
Comment thread python/test/unit/language/test_core.py Outdated
@chengjunlu
Copy link
Copy Markdown
Contributor Author

@ThomasRaoux It is very appreciate your effort to try out the fixes. The issue just break out on different CI machines with un-kown reason.

@ThomasRaoux
Copy link
Copy Markdown
Collaborator

@ThomasRaoux It is very appreciate your effort to try out the fixes. The issue just break out on different CI machines with un-kown reason.

I see, very weird. I wonder if different numpy versions generate different random numbers. Maybe we should try much smaller numbers

@ThomasRaoux
Copy link
Copy Markdown
Collaborator

this version seems to pass. If it still fails for you feel free to lower the range mode

@ThomasRaoux ThomasRaoux merged commit f4a9d54 into triton-lang:main Jul 11, 2025
9 checks passed
@lezcano
Copy link
Copy Markdown
Contributor

lezcano commented Jul 11, 2025

It looks like htis PR is introducing some interpreter errors:
https://github.com/triton-lang/triton/actions/runs/16206950799/job/45761231303#step:11:939

@chengjunlu
Copy link
Copy Markdown
Contributor Author

It looks like htis PR is introducing some interpreter errors: https://github.com/triton-lang/triton/actions/runs/16206950799/job/45761231303#step:11:939

This PR is try to fix the interpreter test errors.
With the changes, it is impossible get such large reduce results.

'Python integer 6080852592 out of bounds for int32'

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