Skip to content

Conversation

borontion
Copy link
Contributor

@borontion borontion commented Aug 28, 2025

layoutToGluon will seg fault when taking a SwizzledSharedLayout attribute. Found this issue while using permute on a shared memory with this attribute.

@borontion borontion requested a review from peterbell10 as a code owner August 28, 2025 21:28
@peterbell10
Copy link
Contributor

Thanks for the fix, can you add a test?

@gluon.jit
def shared_memory_permute_kernel(layout: ttgl.constexpr):
smem = ttgl.allocate_shared_memory(ttgl.float16, [4, 128], layout)
smem.permute((1, 0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
smem.permute((1, 0))
perm = smem.permute((1, 0))
ttgl.static_assert(perm.layout == ttgl.SwizzledSharedLayout(1, 1, 1, [0, 1]))

@borontion borontion requested a review from peterbell10 August 29, 2025 16:45
@peterbell10 peterbell10 merged commit 642d59c into triton-lang:main Aug 29, 2025
9 checks passed
@borontion borontion deleted the gluon-fix-layout-object branch August 29, 2025 17:49
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.

2 participants