Repository navigation
mma_ab's shape is the band's, and the two callers that read it as the tile's (#175) - #176
Merged
Merged
Conversation
… tile's `mma_ab` walks one 64-wide output band per `B` subtile, offsetting the accumulator by 64 columns each time, so the instruction descriptor's `N` is the *band's* width and never the tile's. Its own doc said the first half of that and its doctest contradicted it: `M128_N128` over a `[64, 128]` `B` issues band 0 across columns 0..128 and band 1 across 64..192, so band 1 overwrites half of band 0 and the walk runs 64 columns past a `[128, 128]` accumulator. The columns are usually still inside the allocation, so it is a wrong `D` and not a fault. `examples/src/flash_forward.rs` had the same line, for its `O = P·V`, from the day it was written. Its own doc header says why nothing caught it: no launcher, no CPU reference, nothing measured against a known-good `O` (#85). The shipped `O = P·V` in feitreim/oxide-train has always passed `M128_N64` for exactly these operand shapes, B200-validated against two oracles, which is what settles which one is right. The doc now states the rule where a caller reads it and the safety clause carries it, since a `const` assert cannot see a runtime `shape` — making the shape a const parameter, or deriving it from the operands, is #128. Closes #175.
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.
mma_abaccumulates one 64-wide band perBsubtile, attmem + subtile * 64. So the instruction descriptor'sNis the band'swidth, not the
[M, N]the operand tiles describe — and two places in the treepassed the tile's:
src/mma.rs:183,mma_ab's own doctestexamples/src/flash_forward.rs:174,output_shape, used forO = P·VWith
p: [128, 64]andv: [64, 128](2 subtiles),M128_N128issues:Band 1 overwrites half of band 0 and runs 64 columns past a
[128, 128]accumulator. In
flash_forwardthe allocation is 256 columns and the outputtile starts at 64, so nothing faults — it just computes a wrong
O.src/tmem.rs:40is not an instance and is left alone: that ismm_abt,one instruction at
tmemwith no band loop, so itsNisB's row count and128 is right. The two walks disagreeing about what
Nmeans is the trap.What settles which one is right
The shipped
O = P·Vin feitreim/oxide-train has always passedM128_N64forexactly these operand shapes, B200-validated against two oracles.
mma_ab'sown doc already said "One 64-wide output band per
Bsubtile" and "tmemowns64 * B::SUBTILESfp32 columns"; only the example and the doctest disagreed.Why it survived
examples/src/flash_forward.rs:19says it: "Status: compiles, and is inthe default build. There is no launcher and no CPU reference, so nothing here
is measured against a known-good
O." That is #85, and this is the firstthing it has cost — feitreim/oxide-train#68 was told to start from this file's
shape, and this is the one line of it that could not be copied.
What this does not do
Add a check.
shapeis a runtime argument, so noconst { assert!(..) }cansee it; the doc now states the rule at both
mma_abandmm_aband the safetycontract carries a clause for it. Making the shape a const parameter, or
deriving it from the accumulator, is #128 — and this is that issue's
part 2 with a casualty, since for
mma_abunder a 2-byte element andSwizzle128Bthe legalNis the constant 64 and there is no other answer acaller could give.
Gates
scripts/fmt --check,cargo clippy --all-targets -- -D warnings,cargo testclean. The example's PTX changes (a different instructiondescriptor immediate); it is on no correctness gate, which is the point.
Closes #175.