Skip to content

fix: ignore load_ptr_tko padding when no mask is given - #107

Open
mktip wants to merge 1 commit into
NVIDIA:mainfrom
mktip:mktip/bug-load-ptr-padding-without-mask
Open

mktip wants to merge 1 commit into
NVIDIA:mainfrom
mktip:mktip/bug-load-ptr-padding-without-mask

Conversation

@mktip

@mktip mktip commented Sep 26, 2026

Copy link
Copy Markdown

It's downstream bug (one could argue with cuda-tile) when someone (not me) tries to intercepts the built tile-ir bytecode and uses cuda-tile-translate to convert it back to text, instruments it, then compiles it again. Only then they'll notice that it won't compile.

That's because they would have a tile-ir kernel with a load_ptr_tko operation with no mask but a padding (which seems like something cutile-python allows). When this bytecode gets converted to text, since the padding (and mask) arguments are not keyworded and optional, it ends up generating tile-ir text in which the load_ptr_tko has the padding value inplace of the mask value.

I'll mention this issue downstream, but I thought maybe it should be addressed here? unless there is a usage somehow for load_ptr_tko with a padding value and no mask value.

Description

Just that when generating the bytecode of a load_ptr_tko, before assinging the value for the padding optional parameter, we check if a mask was given to begin with, if none were given, then the padding value is also set to none.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

It's downstream bug (one could argue with cuda-tile) when someone (not
me) tries to intercepts the built tile-ir bytecode and uses
cuda-tile-translate to convert it back to text, instruments it, then
compiles it again. Only then they'll notice that it won't compile.

That's because they would have a tile-ir kernel with a `load_ptr_tko`
operation with no mask but a padding (which seems like something
cutile-python allows). When this bytecode gets converted to text, since
the padding (and mask) arguments are not keyworded and optional, it ends
up generating tile-ir text in which the load_ptr_tko has the padding
value inplace of the mask value.

I'll mention this issue downstream, but I thought maybe it should be
addressed here? unless there is a usage somehow for load_ptr_tko with a
padding value and no mask value.

Signed-off-by: Mohammad Issa <mo.issa.ok@gmail.com>
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.

1 participant