flashinfer.fused_moe.TrtllmGenRoutingResult¶
- class flashinfer.fused_moe.TrtllmGenRoutingResult(topk_ids: Tensor, topk_weights: Tensor, total_num_padded_tokens: Tensor, expanded_idx_to_permuted_idx: Tensor, permuted_idx_to_token_idx: Tensor, cta_idx_xy_to_batch_idx: Tensor, cta_idx_xy_to_mn_limit: Tensor, num_non_exiting_ctas: Tensor)¶
Outputs of the trtllm-gen MoE routing stage.
topk_ids/topk_weightsare the per-token expert selection. The remaining fields are the permutation/bookkeeping tensors the fused MoE kernels consume; entries beyond the actual padded count (seetotal_num_padded_tokens) are undefined.In from-logits mode the routing kernels never emit expert ids directly — expert identity lives in the permuted layout.
topk_idsis therefore reconstructed on the torch side: permuted slotpbelongs to CTA tilep // tile_tokens_dim, andcta_idx_xy_to_batch_idxmaps each CTA tile to its expert.- __init__()¶
Methods
__init__()count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
Attributes
cta_idx_xy_to_batch_idxAlias for field number 5
cta_idx_xy_to_mn_limitAlias for field number 6
expanded_idx_to_permuted_idxAlias for field number 3
num_non_exiting_ctasAlias for field number 7
permuted_idx_to_token_idxAlias for field number 4
topk_idsAlias for field number 0
topk_weightsAlias for field number 1
total_num_padded_tokensAlias for field number 2