Skip to content

[CuTe] Validate dynamic tiler divisibility for static layouts (issue #3513) - #3622

Open
XFDG wants to merge 1 commit into
NVIDIA:mainfrom
XFDG:fix/dynamic-tiler-divisibility-3513
Open

XFDG wants to merge 1 commit into
NVIDIA:mainfrom
XFDG:fix/dynamic-tiler-divisibility-3513

Conversation

@XFDG

@XFDG XFDG commented Sep 13, 2026

Copy link
Copy Markdown

Summary

Add runtime shape-divisibility validation when layout composition combines a fully static left-hand layout with a dynamic right-hand tiler.

The existing logical_divide core test now covers both:

  • a compatible dynamic tiler that preserves the input layout size
  • the issue reproducer, which must fail with Shape Divisibility Condition

Rationale

The composition path already diagnoses fully static incompatibilities at compile time. When the right-hand shape is dynamic, however, new_shape and rest_shape become dynamic and the static assertion cannot run. The fallback runtime assertion was skipped even though each left-hand mode was still statically known, allowing an incompatible divide to silently return a non-size-preserving layout.

Limiting the runtime assertion to a statically known curr_shape closes that mixed static/dynamic gap without changing the intentionally permissive fully dynamic path.

Validation

Compiled the same standalone reproducer before and after this change with CUDA 13.1 and -arch=sm_100a, then ran it on an NVIDIA B200.

Before:

  • dynamic tiler 128 returned normally
  • input size was 384, but result size was 288
  • the probe exited with status 2

After:

  • the same invalid tiler aborts with Shape Divisibility Condition (status 134)
  • a compatible dynamic tiler 12 returns normally with input/result size 384
  • git diff --check passes

The cluster image does not provide GTest, so the added core regression test is left for the upstream test target to compile and execute.

Fixes #3513

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.

zipped/tiled divide with a dynamic tiler skips divisibility checks on static layouts and returns a non-size-preserving layout

1 participant