vx-lang / vx-lang/Vx

Heterogeneous targets · P2-2: execution model below spawn (grid/semantics, then roles)

Open
#252 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen core-lang enhancement
Dominant language
Rust
Stars
14
Forks
2
Avg merge
12h 42m
Merged PRs (30d)
61

Description

P2-2 — Execution model below spawn (grid, then roles)

spawn on is a placement; for is sequential. No grid, block, warp, lane, or subcore, and no iteration-space annotation. Peak Blackwell throughput requires warp specialization (producer warps issuing TMA, consumer warps issuing tcgen05.mma, rendezvousing on mbarriers) — you cannot write a Blackwell GEMM in a language with no warps, and unlike the TPU you cannot delegate it (no XLA doing it for you). Largest single piece; most safely deferred.

Stage 1 — annotated grid (worth doing alone; unlocks pipelining on both machines)
spawn on(Topology::TensorCore) grid([n_batch, n_heads, n_kv])
  semantics([parallel, parallel, arbitrary])
{
  let b = grid_index(0);
  let h = grid_index(1);
  ...
}

arbitrary on the KV axis tells the compiler the online-softmax accumulation is order-dependent while batch/head are free — exactly Pallas's DimensionSemantics, and directly usable as gpu.launch_func grid dims.

Stage 2 — roles (sketch, B200-specific, genuinely open design)
spawn on(Topology::TensorCore5) grid([m, n]) semantics([parallel, parallel]) {
  role producer(warps: 1) {
    let t = transfer_async(tile(a, m, n), Memory::SMEM);   // P0-2 token
    yield_to(consumer, t);
  }
  role consumer(warps: 4) {
    let s = await_from(producer);
    mma_acc(s, Memory::TMEM);
  }
}

Stage 2 should not be committed to before P2-1 gives it a backend to land on; recorded so the stage-1 grid syntax is chosen with it in mind.

Where it lands

src/parser/stmt.rs (spawn grammar), src/dialect/VxDialect.cpp (grid/semantics attributes on vx.spawn), VxLowering.cpp (grid → gpu.launch_func dims). Depends on P0-2 (tokens) and P2-1 (backend).


From the Heterogeneous Target Gap Analysis (§9). Status tracked there and in the P0 decision log. Sibling to the landed P0 work (P0-1 fa056b4e, P0-3 33ce0b64, P0-4 5e10637a, P1-4a-core 34b31902).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read docs/discussions/heterogeneous_target_gap_analysis.md §9 and docs/discussions/heterogeneous_p0_decision_log.md, then inspect src/parser/stmt.rs, src/dialect/VxDialect.cpp, and VxLowering.cpp. Resolve the P0-2 and P2-1 dependencies before evaluating the Stage 1 grid syntax. Done means annotated grid and semantics reach the dialect and lower to gpu.launch_func dimensions; Stage 2 roles remain an explicitly deferred design.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
backend, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.