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_moe_gather_quantize_dynamic_block_scaled
struct Struct_moe_gather_quantize_dynamic_block_scaled
Registers the mo.moe.gather.quantize.dynamic.block.scaled graph op with the graph compiler.
Implemented traits
Methods
execute
static def execute[SF_VECTOR_SIZE: Int, TOPK: Int](output: T, scales: T, input: T, token_expert_order: T, context: DeviceContext)
Gathers and quantizes MoE-sorted rows to MXFP8 in one launch.
Sorted row p reads source token row
token_expert_order[p] // TOPK from the bf16 input and
quantizes it as mo.quantize.dynamic.block.scaled does on AMD
CDNA4, producing byte-identical payload and scale rows.
Args:
- output (
T):[P, K]float8_e4m3fn, one row per sorted slot. - scales (
T):[P, K // SF_VECTOR_SIZE]float8_e8m0fnu block scales, row-major. - input (
T):[M, K]bfloat16 activations, one row per token. - token_expert_order (
T):moe_create_indices's[P]uint32 order, withP == M * TOPK. - context (
DeviceContext): The device context.