For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo struct
Struct_ep_dispatch_wait_mxfp4
struct Struct_ep_dispatch_wait_mxfp4
Registers the ep.dispatch_wait.mxfp4 graph op with the graph compiler.
Implemented traitsβ
Methodsβ
executeβ
static def execute[hidden_size: Int, top_k: Int, n_experts: Int, max_token_per_rank: Int, n_gpus_per_node: Int, n_nodes: Int, //, num_input_tokens: Int = Int(-1), *, MX_FORMAT: StaticString = "auto"](output_tokens: T, output_scales: T, row_offsets: T, expert_ids: T, src_info: T, atomic_counters: T, recv_ptrs: T, recv_count_ptrs: T, context: DeviceContext)
Execute the Expert Parallelism dispatch completion kernel. Received tokens are in MXFP4 format: two FP4 elements packed per uint8 in output_tokens with per-token even-mode scales in output_scales.
The kernel writes the E8M0 activation scale directly into the up-proj
grouped matmul's per-expert fixed-stride scale_4d slot layout (KS224
up-proj fusion). A slot holds max_padded_M rows, the most tokens one
expert can receive rounded up to 32, so the scales output tensor has
shape [n_local_experts * max_padded_M, K_SCALES].
runβ
static def run[hidden_size: Int, top_k: Int, n_experts: Int, max_token_per_rank: Int, n_gpus_per_node: Int, n_nodes: Int, num_input_tokens: Int = Int(-1), *, MX_FORMAT: StaticString = "auto", ExpertLoadT: ExpertLoadSink = NullExpertLoad](output_tokens: T, output_scales: T, row_offsets: T, expert_ids: T, src_info: T, atomic_counters: T, recv_ptrs: T, recv_count_ptrs: T, context: DeviceContext, expert_load: ExpertLoadT)
Runs ep.dispatch_wait.mxfp4, reporting each local expert's routed-token count to expert_load.