cuTile Python version
1.5.0. I first found this with 1.4.0 and reproduced it unchanged after loading 1.5.0.
CUDA Toolkit version
13.3 (tileiras V13.3.36)
Which installation method does this occur on?
Pip
Describe the bug
The Python compiler pass cuda.tile._passes.loop_split raises KeyError: 'col.0'
when a runtime loop conditionally updates a loop-carried scalar. A one-iteration
loop and a one-block launch are sufficient. I expected the kernel to compile and
write the final value, or to receive a user-facing diagnostic if this loop form is
unsupported. An internal dictionary lookup should not escape from the compiler.
This was reduced from a Cholesky kernel that converted a triangular pair index to
row and column coordinates. The original failure occurred while compiling that
specialization's _update_trailing kernel, before the failing kernel executed.
Minimum reproducible example
Save this as repro.py:
import torch
import cuda.tile as ct
@ct.kernel
def kernel(output, stop: int):
col = ct.bid(0)
for i in range(stop):
if col > i:
col -= i + 1
ct.store(output, (0,), col)
output = torch.empty((1,), device="cuda", dtype=torch.int32)
ct.launch(torch.cuda.current_stream(), (1,), kernel, (output, 1))
Run it in a fresh process and cache directory:
run=$(mktemp -d)
CUDA_TILE_CACHE_DIR=off \
CUDA_TILE_TEMP_DIR="$run" \
python repro.py
I ran this twice with independent empty cache directories on 1.4.0 and again on
1.5.0. Every run failed in the same pass with the same key.
Relevant log output
Traceback (most recent call last):
...
File "cuda/tile/_compile.py", line 113, in _transform_ir
split_loops(func_body)
File "cuda/tile/_passes/loop_split.py", line 170, in split_loops
_find_splittable_loops(block, dict(), 0, None, None, dict(), dict(), splittable_loops)
File "cuda/tile/_passes/loop_split.py", line 53, in _find_splittable_loops
_find_splittable_loops(...)
File "cuda/tile/_passes/loop_split.py", line 36, in _find_splittable_loops
elif rhs.name == induction_var and def_depth[lhs.name] < depth:
~~~~~~~~~^^^^^^^^^^
KeyError: 'col.0'
Environment
OS: Ubuntu 22.04.5 LTS, Linux 6.8.0-90-generic x86_64
GPU: NVIDIA RTX PRO 6000 Blackwell Server Edition, compute capability 12.0
Driver: 580.126.09
CUDA toolkit: 13.3; nvcc 13.3.33; tileiras V13.3.36
Python: 3.13.14
PyTorch: 2.12.0+cu130 (bundled CUDA runtime 13.0)
cuTile Python: 1.5.0; also reproduced on 1.4.0
CPU: AMD EPYC 9355, 16 vCPUs
Other details
The larger source loop carried both row and col; removing row, reducing the grid to
one block, and reducing the runtime trip count to one still leaves this failure.
Contributing Guidelines
cuTile Python version
1.5.0. I first found this with 1.4.0 and reproduced it unchanged after loading 1.5.0.
CUDA Toolkit version
13.3 (
tileirasV13.3.36)Which installation method does this occur on?
Pip
Describe the bug
The Python compiler pass
cuda.tile._passes.loop_splitraisesKeyError: 'col.0'when a runtime loop conditionally updates a loop-carried scalar. A one-iteration
loop and a one-block launch are sufficient. I expected the kernel to compile and
write the final value, or to receive a user-facing diagnostic if this loop form is
unsupported. An internal dictionary lookup should not escape from the compiler.
This was reduced from a Cholesky kernel that converted a triangular pair index to
row and column coordinates. The original failure occurred while compiling that
specialization's
_update_trailingkernel, before the failing kernel executed.Minimum reproducible example
Save this as
repro.py:Run it in a fresh process and cache directory:
I ran this twice with independent empty cache directories on 1.4.0 and again on
1.5.0. Every run failed in the same pass with the same key.
Relevant log output
Environment
Other details
The larger source loop carried both
rowandcol; removingrow, reducing the grid toone block, and reducing the runtime trip count to one still leaves this failure.
Contributing Guidelines