Skip to content
Kitbay
Skill

cuda-index-width

NOASSERTIONUpdated on Nov 11, 2026105,390GitHub stars

A contributor skill in the PyTorch repository for fixing integer overflow in CUDA kernel indexing, such as failures on tensors near two billion elements.

What the skill teaches

A contributor skill in the PyTorch repository for fixing integer overflow in CUDA kernel indexing, such as failures on tensors near two billion elements. The agent finds the exact expression that can overflow instead of switching every index to 64 bits, then picks a fix by where the code runs: a local 64-bit cast for one-off setup maths, a kernel templated on the index type for hot loops, an early size check for kernels that only support 32 bits, or tiling when the launch grid itself is too large. It uses PyTorch's existing helpers, weighs binary size and speed with A/B builds, adds a regression test at the boundary and runs the case under compute-sanitizer.

Capabilities

Not stated in its documentation