Gfx1250 tdm gather scatter#833
Open
coderfeli wants to merge 1 commit into
Open
Conversation
Re-add gfx1250 TDM gather/scatter, layered on the existing target-neutral
fx.gather / fx.scatter interface (examples/05-gather_scatter.py) instead of a
bespoke gather op. A whole-tile TDM gather atom now lowers to a single
rocdl.tensor.load.to.lds / store.from.lds.
- Shared copy path: add an optional `indices` memref operand to fly.copy_atom_call
and fly.copy (AttrSizedOperandSegments; keyword-led assembly to stay
unambiguous vs the bare optional `pred`). Thread Type/Value through both memref
emitAtomCall interface overloads, CopyAtomType, every copy impl (universal,
CDNA3, CDNA4, GFX1250), FlyToROCDL, and the LayoutLowering expand-copy
(indices only on the whole-tile path). Non-gather atoms ignore it.
- CopyOpGFX1250TDM gains a `mode` enum {tiled, gather}. Gather emit derives the
row-index width from the indices operand element type (i16/i32) and the row
count from its static extent, packing them into the descriptor; base / extents /
row stride come from atom state (verify: gather => rank 2).
- fx.gather / fx.scatter route on a new generic copy_atom.copy_rank (> 1 =>
whole-tile): one copy_atom_call with the offset tensor as the indices operand,
base_iter only supplying the global shape token. expr/ stays ROCDL-free.
- Python: make_tdm_gather_atom, TDM(mode=...), copy_rank; NOTICE credits Triton
(MIT) for the ported TDM descriptor packing.
Tests: new tdm_gather_gfx1250.mlir FileCheck (i32 load/store, i16 pack) and a
mode=gather roundtrip; existing tdm type strings updated for the mode field.
Verified: build; 10/10 copy/tdm/gfx1250 FileCheck; unit + expr-optional; examples
01/02/05 and vec_add on gfx942 (the indices=None default path). A runnable
gfx1250 gather kernel is deferred (host is gfx942).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
coderfeli
force-pushed
the
gfx1250_tdm_gather_scatter
branch
from
July 12, 2026 13:07
da865a5 to
2ae7140
Compare
Comment on lines
+91
to
+95
| from flydsl._mlir.dialects import fly # noqa: F401 | ||
| from flydsl._mlir.dialects import fly_rocdl # noqa: F401 | ||
| from flydsl._mlir.dialects.fly import CopyAtomType | ||
| from flydsl.expr.rocdl import universal as U | ||
|
|
Contributor
There was a problem hiding this comment.
Import block is un-sorted or un-formatted
Suggested change
| from flydsl._mlir.dialects import fly # noqa: F401 | |
| from flydsl._mlir.dialects import fly_rocdl # noqa: F401 | |
| from flydsl._mlir.dialects.fly import CopyAtomType | |
| from flydsl.expr.rocdl import universal as U | |
| from flydsl._mlir.dialects import ( | |
| fly, # noqa: F401 | |
| fly_rocdl, # noqa: F401 | |
| ) | |
| from flydsl._mlir.dialects.fly import CopyAtomType | |
| from flydsl.expr.rocdl import universal as U | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist