Skip to content

[mlir][dxsa] Add gather4 variants#203

Merged
asavonic merged 1 commit into
dxsa-mlirfrom
dxsa-mlir-gather4
Jul 2, 2026
Merged

[mlir][dxsa] Add gather4 variants#203
asavonic merged 1 commit into
dxsa-mlirfrom
dxsa-mlir-gather4

Conversation

@asavonic

Copy link
Copy Markdown
Contributor

Please ignore the first commit in the stack. It is reviewed separately in #182.

@asavonic asavonic requested a review from tagolog June 26, 2026 10:54

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With the latest PRs, I've introduced a new approach to test files that was approved by Anton.

Can we combine all gather-related tests to a single test file gather_ops.test and run mlir-translate with --split-input-file option?
atomic_ops.test

// RUN: mlir-translate --split-input-file --import-dxsa-hex %s | FileCheck %s
// RUN: mlir-translate --split-input-file --import-dxsa-hex %s | mlir-opt --split-input-file --verify-roundtrip

// CHECK-LABEL: dxsa.module {
// CHECK-NEXT:   dxsa.atomic_and u<0>, r<0>, r<1, <x>>
// CHECK-NEXT: }
0x070000a9, 0x0011e000, 0x00000000, 0x00100e46, 0x00000000, 0x0010000a, 0x00000001

// -----

// CHECK-LABEL: dxsa.module {
// CHECK-NEXT:   dxsa.atomic_and g<0>, r<2>, r<3, <x>>
// CHECK-NEXT: }
0x070000a9, 0x0011f000, 0x00000000, 0x00100e46, 0x00000002, 0x0010000a, 0x00000003

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What is the reason to split instructions into individual modules?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A couple of reasons, most of them about making failures point at a single instruction rather than at a blob:

  1. Per-variant round-trip. The --verify-roundtrip run is the main motivation. In one big dxsa.module the first round-trip mismatch aborts the whole check, so you never learn whether the remaining variants still round-trip. With --split-input-file each variant is verified independently, so a regression lands on exactly one block.

  2. Independent import. If one opcode mis-decodes, it can shift the token stream for everything that follows in the same module and produce misleading cascade failures. Isolated modules keep a decode bug contained to its own case.

So the split is not about isolating the ops conceptually, it's about isolating failures per variant while keeping the whole family in a single reviewable file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree. Let's split the tests if we encounter any issues next time.

Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp Outdated
@asavonic asavonic force-pushed the dxsa-mlir-gather4 branch from 0e35e7c to a84755b Compare July 2, 2026 08:27
@asavonic asavonic force-pushed the dxsa-mlir-gather4 branch from a84755b to 6e8e51c Compare July 2, 2026 08:29
@asavonic asavonic merged commit 182600c into dxsa-mlir Jul 2, 2026
5 checks passed
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