Skip to content

fix: validate runtime tensor strides before kernel launch - #1450

Open
uurl wants to merge 1 commit into
NVIDIA:mainfrom
uurl:fix/cutile-launcher-stride-validation
Open

uurl wants to merge 1 commit into
NVIDIA:mainfrom
uurl:fix/cutile-launcher-stride-validation

Conversation

@uurl

@uurl uurl commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Closes #1449

Generated launchers now reject tensor arguments whose actual strides disagree with the compiled specialization. For example, runtime strides [2, 1] are rejected when the specialization requires [1, 1], while [-1, 1] accepts the dynamic first-axis stride.

The change preserves compiled strides in TensorParamType and validates stride rank and constant axes for immutable inputs, mutable partitions, and mapped outputs. Validation also runs for compile-only requests.

Output bindings expose their underlying tensor strides through KernelOutputStored::strides(). Custom implementations of this trait must implement the new accessor.

Regression coverage includes stride matching, compiler metadata propagation, underlying output strides, rejection of inconsistent specialization metadata before and after cache population, and successful execution with dynamic strides.

Validation

From the repository root:

cargo fmt --all -- --check
cargo test -p cuda-async --lib tensor_stride_tests

cd cutile-rs
cargo fmt --all -- --check
cargo test -p cutile --lib output_bindings_report_underlying_tensor_strides
cargo test -p cutile --test specialization_bits validator_
cargo test -p cutile --test gpu launcher_guards::
cargo clippy -p cutile -p cutile-compiler -p cutile-macro --all-targets -- -D warnings
bash scripts/run_all.sh

All checks passed. The full runner passed its CPU/GPU suites, 24 examples, and all 8 benchmark smoke tests. Three examples were skipped because they require newer Tile IR versions than the installed 13.2.

Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
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.

cuTile launchers lack runtime tensor stride validation

1 participant