Skip to content

restructure gather fixtures: parallel gather_kernel becomes default - #116

Draft
lasch wants to merge 1 commit into
torch-spyre:mainfrom
lasch:issue-11/gather-parallel
Draft

restructure gather fixtures: parallel gather_kernel becomes default#116
lasch wants to merge 1 commit into
torch-spyre:mainfrom
lasch:issue-11/gather-parallel

Conversation

@lasch

@lasch lasch commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Adds new gather_kernel, old default to gather_kernel_1core

Adds gather_kernel, a row-tiled/parallel variant, and makes it the
fixture's default so DistributeWork has real work to do in the common
case. gather_kernel is renamed to gather_kernel_1core (base: None,
unchanged in meaning); the six column-slice edge variants rebase onto
the new default and become parallel; large_k stays single-program to
avoid changing its fan-out semantics.

Updates fixtures/README.md and fixtures/gather/README.md to match,
and regenerates the CI-gated docs/patterns/memory.md.

Note: if the scope of #11 includes 3D+ kernels, then this is not yet fully closing issue #11
This is only doing the first few gather kernels and their parallel issue.

Scope

  • Spyre backend or KTIR lowering
  • Tests or fixtures
  • Build, packaging, or CI
  • Documentation or repository metadata
  • Upstream Triton sync or compatibility

Testing

  • I ran the relevant tests, or explained why they were not run.
  • I added or updated tests when behavior changed.

Commands and results:


Checklist

  • I initialized or updated submodules when needed.
  • I checked public-facing text for private links or internal-only references.
  • If this touches upstream Triton files outside third_party/spyre, I explained why in the summary.

@lasch
lasch requested a review from fabianlim August 28, 2026 18:50
  Adds new gather_kernel, old default to gather_kernel_1core

  Adds gather_kernel, a row-tiled/parallel variant, and makes it the
  fixture's default so DistributeWork has real work to do in the common
  case. gather_kernel is renamed to gather_kernel_1core (base: None,
  unchanged in meaning); the six column-slice edge variants rebase onto
  the new default and become parallel; large_k stays single-program to
  avoid changing its fan-out semantics.

  Updates fixtures/README.md and fixtures/gather/README.md to match,
  and regenerates the CI-gated docs/patterns/memory.md.

Signed-off-by: Lars Schneidenbach <schneidenbach@us.ibm.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lasch
lasch force-pushed the issue-11/gather-parallel branch from fc48b68 to 2197dc6 Compare August 28, 2026 18:56
@fabianlim fabianlim linked an issue Aug 28, 2026 that may be closed by this pull request
"1core": {
# gather_kernel_1core: the one variant in this fixture that pins
# the no-scf.for shape — a single descriptor_gather call consumes
# the whole index array in one shot, no tl.program_id, no row

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i think we can reduce the amount of comments here, keep it short like 1-2 lines

},
"tags": ["descriptor-gather"],
"tags": ["descriptor-gather", "1core"],
"summary": (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just say what it is no need to sound apologetic.

# alone wouldn't catch a bug that triggers only at the
# smallest legal block. Allows duplicates so an aliasing bug
# at the minimum size shows up.
# Smallest legal sizes per the verifier: BLOCK_ROWS=8 (verifier

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

BLOCK_ROWS=8 is locked in because of a check that no longer applies to Spyre.**
meta.py:1077 justifies BLOCK_ROWS=8 with "Triton frontend requires
x_offsets.shape[0] >= 8 for tt.descriptor_gather". That was true for NVIDIA
TMA, but semantic.py:1163-1164 shows the check is now guarded by
if not target_info.is_spyre() — the minimum was released for Spyre when the
guard was added. All seven new gather_kernel variants are pinned to 8 for no
reason. The fixture could use smaller values to cover more of the space (e.g.
BLOCK_ROWS=4 for a two-row tile) and the comment should be corrected.
(meta.py:1075-1078, semantic.py:1163)

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.

Investigate making the gather examples parallel

2 participants