IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

sched_dsread_valu_pairs

def sched_dsread_valu_pairs[pairs: Int, valu_cnt: Int, group: Int]()

Emits pairs schedule groups of shape [1 DS_READ, valu_cnt VALU].

DS_READ variant of sched_barrier_pairs for clusters that have NO MFMAs but want to interleave LDS-reads with VALU work — typically V-load + causal-mask clusters (the MHA kernel's C5 / EPI_C5 / EPI_C9). The interleave hides the v_cmp→v_cndmask wait state (5 cycles, gated by s_nop 1 if not filled) behind useful ds_read_b64_tr_b16 work.

Same sync_id rule as sched_barrier_pairs: pick a fresh group distinct from MFMA/VALU/TRANS pair sequences in other clusters.

Parameters:

  • pairs (Int): Number of (DS_READ, VALU) groups to emit.
  • valu_cnt (Int): VALU instructions per group (typically 2 for one cmp+cndmask pair per ds_read).
  • group (Int): IGroupLP sync_id.