vllm.models.common.ops.sequence_parallel
¶
Functions:
-
can_sp_all_gather_matmul–Whether
sp_all_gather_matmulapplies to this shard and weight. -
is_sequence_parallel_active–Whether a batch of
num_tokensshards the stream along the sequence. -
sp_all_gather_matmul–sp_all_gather(x) @ weight.T, overlapping the gather with the GEMM.
can_sp_all_gather_matmul(x, weight)
¶
Whether sp_all_gather_matmul applies to this shard and weight.
Source code in vllm/models/common/ops/sequence_parallel.py
is_sequence_parallel_active(is_enabled, num_tokens, min_tokens=0)
cached
¶
Whether a batch of num_tokens shards the stream along the sequence.
Below one token per rank the shards are mostly padding, so the batch
stays replicated. A model may raise this lower bound with min_tokens.
Source code in vllm/models/common/ops/sequence_parallel.py
sp_all_gather_matmul(x, weight)
¶
sp_all_gather(x) @ weight.T, overlapping the gather with the GEMM.