new pto.mi and vmi dsl primitives for RoPE kernel - #498
Open
learning-chip wants to merge 60 commits into
Open
Conversation
Companion to rope_mi.py: loads the hand-authored VMI surface IR from
rope_{f16,bf16,f32}.vmi.pto instead of tracing a Python function body,
exercising the source=... jit path fixed alongside the mi backend.
Verified against the rope VF sim harness in a5-kernel-standalone: all
6 dtype/mode variants (f16/bf16/f32 x half/interleave) pass for both
rope_mi.py and rope_vmi.py.
castigli
reviewed
Jul 13, 2026
castigli
left a comment
There was a problem hiding this comment.
I don't see standalone python tests for the new primitives, vdintlv/vintlv, worth adding.
Comment on lines
+42
to
45
| def _mlir_uses_vmi_dialect(mlir_text: str) -> bool: | ||
| return "pto.vmi." in mlir_text | ||
|
|
||
|
|
There was a problem hiding this comment.
_mlir_uses_vmi_dialect does a raw substring check that could false-positive on comments/string literals containing pto.vmi.. Consider a slightly more robust check
add pto.vmi dsl rope example
learning-chip
marked this pull request as ready for review
July 13, 2026 14:43
| dtype | mode | backend | RVEC span | MaxDur |
|-------|------|---------|----------:|-------:|
| f16 | HALF | cce | **1692** | 8235 |
| f16 | HALF | mi | **19231** | 25159 |
| f16 | HALF | vmi | **19229** | 25137 |
| f16 | INTERLEAVE | cce | **3036** | 9324 |
| f16 | INTERLEAVE | mi | **21320** | 27218 |
| f16 | INTERLEAVE | vmi | **17958** | 23846 |
| bf16 | HALF | cce | **2896** | 9332 |
| bf16 | HALF | mi | **22111** | 28057 |
| bf16 | HALF | vmi | **22109** | 28024 |
| bf16 | INTERLEAVE | cce | **3724** | 10046 |
| bf16 | INTERLEAVE | mi | **25160** | 31087 |
| bf16 | INTERLEAVE | vmi | **17958** | 23861 |
| f32 | HALF | cce | **1691** | 9231 |
| f32 | HALF | mi | **19217** | 26442 |
| f32 | HALF | vmi | **19229** | 26449 |
| f32 | INTERLEAVE | cce | **3036** | 10440 |
| f32 | INTERLEAVE | mi | **21295** | 28495 |
| f32 | INTERLEAVE | vmi | **17478** | 24847 | |
mouliangyu
force-pushed
the
feature-vmi
branch
2 times, most recently
from
July 21, 2026 06:41
f090b05 to
adcbeb9
Compare
mouliangyu
force-pushed
the
feature-vmi
branch
4 times, most recently
from
July 28, 2026 01:18
66d0335 to
6404205
Compare
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.
by @MirkoDeVita98
See
ptodsl/examples/rope_mi.pyandptodsl/examples/rope_vmi.pyvmi vs mi accuracy agree learning-chip#2