Skip to content

fix: implement Tile::shape() in cuTile kernels - #1844

Open
dzheltkov wants to merge 1 commit into
NVIDIA:mainfrom
dzheltkov:fix/cutile-tile-shape
Open

dzheltkov wants to merge 1 commit into
NVIDIA:mainfrom
dzheltkov:fix/cutile-tile-shape

Conversation

@dzheltkov

@dzheltkov dzheltkov commented Nov 20, 2026 •

Copy link
Copy Markdown

Closes #1843.

Tile<E, D>::shape() now returns the dimensions in D. Its previous unreachable!() body was reachable whenever a kernel called the method. The rank-specialization macro now expands D in an expression to the array of extents (for example, [D0, D1] at rank two). An explicit local Shape<D> lets the JIT use the result directly as a function argument.

The regression reduces a matrix to its row sums and computes the mean square of their positive parts. It uses the intermediate vector's shape both to construct a matching zero tile and to read the number of rows.

Verification

  • Compiling the regression to Tile IR with no visible CUDA device reproduces the error on the base revision and passes with the fix.
  • The execution test checks the same eight input values as a 2×4 and a 4×2 matrix. The scalar results are exactly 4.5 and 4.0, respectively.
  • The full cutile-rs/scripts/run_all.sh passed, including the CPU and GPU suites and all eight benchmark smoke tests. Of the examples, 24 passed and five were skipped.

Return the extents carried by the tile type. Expand a const-generic array used as a value when generating Rust for each rank, so the method can return all its dimensions.

Exercise the method on a vector of row sums and verify the mean square of their positive parts for two rectangular matrices.

Signed-off-by: Dmitry Zheltkov <[email protected]>
Signed-off-by: dzheltkov <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 20, 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.

@dzheltkov
dzheltkov marked this pull request as ready for review November 20, 2026 11:19
@dzheltkov
dzheltkov requested a review from elibol as a code owner November 20, 2026 11:19

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: Tile::shape() fails during compilation to Tile IR

1 participant