TileOP: fix element-vs-byte B.IOR stride in MGATHER/MSCATTER and TPREFETCH (#31 remainder) - #95
Merged
Merged
Conversation
…FETCH Completes the byte-stride contract from #31 (SuperScalarModel 2d467114): the generic TLOAD/TSTORE and the layout-converting load/store family were already fixed to GetStrideBytes(3), but 17 sites still passed GetStride(3) — a logical-element row stride — into the B.IOR row-stride slot, which the model interprets as bytes: - MGATHER / MSCATTER / MGATHER_MASK / MSCATTER_MASK (4 sites each): for an FP16 [32,64] GM the B.IOR stride encoded 64 (elements) instead of 128 bytes, so every logical row after the first was read from a half-row offset — the same corruption pattern #31 reported for TLOAD. - TPREFETCH: same element-stride slip; comment updated to name the byte contract. Verified by disassembly: MGATHER FP16 [32,64] now encodes 128; TPREFETCH FP16 RowMajor<8,512> encodes 1024. Full gate 64/74 (11 failures identical on baseline); unittest 40/40.
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.
Closes the remaining half of #31.
Status of the original report
The main TLOAD/TSTORE paths from the report are already fixed on current linx: the generic TLOAD/TSTORE and the whole layout-converting family (TLOAD2/4_*, TLOAD_CUBE, TSTORE_CUBE, TSTORE_PART) use
GetStrideBytes(3). Verified with the issue's own repro shape — FP16 [32,64] TLOAD encodes B.IOR stride 128 (64 elements × 2 bytes), not 64.What was still broken (this PR)
Auditing every
B.IORstride site found 17 leftovers still passingGetStride(3)— a logical-element stride — into the byte-interpreted slot:All 17 sites now use
GetStrideBytes(3)— the same(elements * bits + 7) / 8conversion the report cited as the correct reference from TLoadBackend/TStoreBackend.Verification