Skip to content

docs(mir-importer): TMA is the Tensor Memory Accelerator, and three translator rows were missing - #996

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/mir-importer-tma-and-translator-rows
Aug 19, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/mir-importer-tma-and-translator-rows

Conversation

@vyncint

@vyncint vyncint commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Two follow-ups from the #978 merge note.

The TMA expansion

You flagged that #978's tma row was copied verbatim from tma.rs, whose own doc comment says "Tensor Memory Access". The unit is the Tensor Memory Accelerator, and the tree already says so in 22 places — including cuda-device/src/tma.rs, dialect-nvvm/src/ops/generated/tma.rs, and the book chapter of that name. mir-importer was the holdout, in four places:

src/translator/terminator/intrinsics/tma.rs:6    module doc
src/translator/terminator/intrinsics/tma.rs:34   fn doc prose
src/translator/terminator/intrinsics/mod.rs:18   table row
README.md:105                                    table row

All four now read "Accelerator", and Tensor Memory Access no longer appears anywhere under crates/mir-importer/. Fixing the source alone would have left the README I just landed disagreeing with it, so both move together.

This is the cost of the verbatim-from-doc-comment rule #977 and #978 adopted: it cannot drift from the source, which also means it faithfully reproduces the source's mistakes. Worth the trade — but the fix has to land in the source.

The three translator rows

src/translator/mod.rs carries the same module table as the README and was short the same three modules #978 added there: layout, location, payload_store.

One claim I checked and am not making

Unlike #977's table, making these rows intra-doc links does not put them under the docs gate. translator is pub(crate) mod since 4c1d5838 (#833, "stop exporting the translator"), so cargo doc --no-deps never documents it and an unresolved link there is not an error. Verified by adding a [ghost_module] row and watching the gate pass.

It does fail under --document-private-items — but that flag also surfaces three pre-existing unresolved links elsewhere in the crate (MirFieldAddrOp, MirArrayElementAddrOp, MirArrayType), so turning it on is its own piece of work, not a free win here. The rows are links because the seven around them are; the enforcement claim belongs only to #977's table.

Testing

Local, no GPU.

  • The translator table is exactly the 9 files in translator/ plus the terminator subdirectory it also lists
  • The README's tma row and tma.rs's doc comment are byte-identical again
  • cargo test -p mir-importer (1090 tests) and the docs gate clean
  • cargo oxide run <example> — not applicable

…ranslator rows were missing

Two follow-ups from the NVIDIA#978 merge note.

**The TMA expansion.** You flagged that NVIDIA#978's `tma` row was copied verbatim
from `tma.rs`, whose own doc comment says "Tensor Memory Access". The unit is
the Tensor Memory *Accelerator*, and the tree already says so in 22 places --
including `cuda-device/src/tma.rs`, `dialect-nvvm/src/ops/generated/tma.rs`,
and the book chapter of that name. mir-importer was the holdout, in four
places, so fixing the source alone would have left the README I just landed
disagreeing with it:

  src/translator/terminator/intrinsics/tma.rs:6    module doc
  src/translator/terminator/intrinsics/tma.rs:34   fn doc prose
  src/translator/terminator/intrinsics/mod.rs:18   table row
  README.md:105                                    table row

All four now read "Accelerator", and `Tensor Memory Access` no longer appears
anywhere under `crates/mir-importer/`.

This is the cost of the verbatim-from-doc-comment rule NVIDIA#977 and NVIDIA#978 adopted:
it cannot drift from the source, which also means it faithfully reproduces the
source's mistakes. Worth the trade, but the fix has to land in the source.

**The three translator rows.** `src/translator/mod.rs` carries the same module
table as the README and was short the same three modules NVIDIA#978 added there:
`layout`, `location` and `payload_store`.

One thing I checked and will not claim: unlike NVIDIA#977's table, making these rows
intra-doc links does **not** put them under the docs gate. `translator` is
`pub(crate) mod` since 4c1d583 (NVIDIA#833, "stop exporting the translator"), so
`cargo doc --no-deps` never documents it and an unresolved link there is not an
error. Verified by adding a `[`ghost_module`]` row and watching the gate pass.
It does fail under `--document-private-items` -- but that flag also surfaces
three pre-existing unresolved links elsewhere in the crate
(`MirFieldAddrOp`, `MirArrayElementAddrOp`, `MirArrayType`), so turning it on
is its own piece of work, not a free win here. The rows are links because the
seven around them are; the enforcement claim belongs only to NVIDIA#977's table.

Verified: the translator table is now exactly the 9 files in `translator/` plus
the `terminator` subdirectory; the README's `tma` row and `tma.rs`'s doc
comment are byte-identical again; `cargo test -p mir-importer` and the docs
gate are clean.

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added documentation Improvements or additions to documentation codegen Device code-generation pipeline (Rust MIR to IR to PTX) intrinsics Device intrinsics and libdevice math mappings labels Aug 19, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

@nihalpasham
nihalpasham merged commit 68c7917 into NVIDIA:main Aug 19, 2026
80 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codegen Device code-generation pipeline (Rust MIR to IR to PTX) documentation Improvements or additions to documentation intrinsics Device intrinsics and libdevice math mappings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants