vllm.models.minimax_m3.amd.sample_akr
¶
The amd_kernels sampling route (gfx950, TP4, with
--enable-batch-sharded-sampling): the target's logits exchange, the sampler-output
gather and the DSpark draft's Markov steps on
amd_kernels.sampling.batch_sharded_markov_v200064_h6144_r256_ranks4. The
draft-logits cache keeps one row per request slot (SlotDraftLogitsCache): upstream's
compact sharded cache hands a skipped request's row to another request. Sampling is
upstream's (same draws: seed, position, vocab id; bf16 bits exchanged).
Functions:
-
configure–From the target's
__init__: the model runner's batch-sharded hooks -
gather_sampler_output–batch_shard.gather_sampler_outputwith the token / count / NaN part in one -
setup–From the draft's set-up (every TP rank, before any capture): the target's owned
_markov_draft(model, spec, num_reqs, head_hidden)
¶
The speculator's sample_sequential_sharded hook: its Markov loop on the
library chain (same draws, ids and cache rows).
Source code in vllm/models/minimax_m3/amd/sample_akr.py
_sampler(device)
¶
The library's BatchShardedSampling, built (and warmed up) collectively at
first use: the draft's set-up or the target's first batch-sharded step.
Source code in vllm/models/minimax_m3/amd/sample_akr.py
_target_logits_owned(lm, hidden_states, sorted_logits_indices, md)
¶
[owned logits rows, 200064] bf16 on this rank, bit for bit what upstream's
compute_logits_local + all_to_all_vocab_shards give.
Source code in vllm/models/minimax_m3/amd/sample_akr.py
configure(vllm_config, model)
¶
From the target's __init__: the model runner's batch-sharded hooks
(compute_logits_local, gather_sampler_output_owned).
Source code in vllm/models/minimax_m3/amd/sample_akr.py
gather_sampler_output(local_output, metadata, device, global_batch, local_batch, gather_num_nans=False, logprobs_dims=None)
¶
batch_shard.gather_sampler_output with the token / count / NaN part in one
library launch; the logprobs keep upstream's gathers. Same tensors, same values.
Source code in vllm/models/minimax_m3/amd/sample_akr.py
setup(spec, model, target_model)
¶
From the draft's set-up (every TP rank, before any capture): the target's owned logits on the shuffled lm_head, the slot-row draft cache and, where the draft fits, the library's Markov chain (collective; it warms up on its first call).