Skip to content

feat: movmatrix in-register matrix transpose - #268

Closed
honeyspoon wants to merge 4 commits into
NVIDIA:mainfrom
honeyspoon:add-movmatrix
Closed

honeyspoon wants to merge 4 commits into
NVIDIA:mainfrom
honeyspoon:add-movmatrix

Conversation

@honeyspoon

Copy link
Copy Markdown
Contributor

Summary

  • Adds movmatrix.sync.aligned.m8n8.trans.b16 support across all compiler layers (cuda-device stub, dialect-nvvm op, mir-importer, mir-lower)
  • New wmma module in each layer for warp-level matrix operations
  • Each thread provides a u32 (2 packed b16 elements); the instruction transposes the 8×8 tile distributed across the warp, avoiding a shared-memory round-trip

Closes #43
Ref #27

Test plan

  • cargo check -p cuda-device -p dialect-nvvm -p mir-importer -p mir-lower passes
  • test_movmatrix_trans_b16_lowers_to_inline_asm verifies lowering to convergent inline PTX
  • All 10 existing lowering tests continue to pass

Runs rustfmt, clippy, and unit tests on packages that don't need the
CUDA toolkit. Triggers on every push to PR branches.
Add quality gates beyond upstream CI to catch maintainer fixup patterns
before pushing PRs:

- rustdoc: build docs with -D warnings (catches bare bracket links)
- cargo-deny: dependency security and license checks
- style-checks job with diff-aware checks for:
  - em-dashes in doc comments (error)
  - bare brackets in doc comments (warning)
  - SPDX license headers on new files (error)
  - unnecessary &mut on pliron type getters (error)
  - float equality assertions (warning)
  - useless &vec![...] patterns (warning)

All style checks are diff-aware (only flag added lines, not pre-existing
upstream code).
ci: enhance fork CI with rustdoc, style checks, and cargo-deny
Implements the movmatrix in-register 8x8 matrix transpose for b16
elements across a warp's register file (PTX movmatrix.sync.aligned.m8n8.trans.b16).

New files:
- cuda-device/src/wmma.rs: device stub (movmatrix_trans_b16)
- dialect-nvvm/src/ops/wmma.rs: MovmatrixTransB16Op (1 operand, 1 result)
- mir-importer intrinsics/wmma.rs: MIR import with result mapping
- mir-lower intrinsics/wmma.rs: convergent inline PTX lowering

Closes #43
Ref #27
@honeyspoon

Copy link
Copy Markdown
Contributor Author

Created on wrong repo by mistake, re-creating on honeyspoon/cuda-oxide fork.

@honeyspoon honeyspoon closed this Jun 22, 2026
meefs pushed a commit to meefs/cuda-oxide that referenced this pull request Sep 30, 2026
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.

1 participant