[BUG] Potential overflow issue in packed_stride.hpp
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.5k
- Forks
- 2.1k
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 7
Description
Hello,
I am no CUDA expert but stumble on a potential bug in my code and it seems there might be an issue here:
https://github.com/NVIDIA/cutlass/blob/546c3efa899ed1793d178a26fe764d63f93b49ea/tools/util/include/cutlass/util/packed_stride.hpp#L85
There is an upcast to IntT but I encoutered a situation where the two values are both int32 but their multiplication is overflowing, in my case:
49 152 × 65 536, leading to negative value even after upcast.
This issue might be present in the next block as well.
Kind regards
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting tools/util/include/cutlass/util/packed_stride.hpp at line 85 and the following block. Reproduce the reported case with 49,152 × 65,536 using int32 values, then verify that the packed-stride calculation does not overflow and that both mentioned blocks behave consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100