Skip to content

[CuTeDSL] Fix swizzled composed layout slice affine abort - #3605

Open
Cansult wants to merge 1 commit into
NVIDIA:mainfrom
Cansult:fix/swizzled-composed-layout-slice-affine
Open

Cansult wants to merge 1 commit into
NVIDIA:mainfrom
Cansult:fix/swizzled-composed-layout-slice-affine

Conversation

@Cansult

@Cansult Cansult commented Sep 9, 2026

Copy link
Copy Markdown

Summary

  • slice_and_offset uses y_z_projection and layout composition to determine whether the Y/Z bits collide. However, composition requires rest.stride to be divisible by curr_shape. When this condition is not satisfied, it returns an unchecked error, which can eventually lead to this abort.
  • Even if this condition is checked and the original layout is returned, the current approach can still produce incorrect decay results in some corner cases, such as when bits overlap between different modes or when carries occur between different modes.
  • Therefore, instead of composition(last_index), this change uses a more conservative approach to determine the potentially active bits (I haven't found a better approach yet), and then performs a bitwise AND with the Y/Z mask to determine whether the Y/Z bits collide.

Testing

  • test/cg_composed_layout_test
  • git diff --check

Fixes #3454

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.

[BUG] cute.slice_ SIGABRTs on a static swizzled ComposedLayout

1 participant