[Perf][DSV4.1] Optimize MegaMoE staging and NVFP4 cache gathers (#57604)
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -584,7 +584,11 @@ def dequantize_and_gather_k_cache_triton(
|
||||
num_reqs = seq_lens.shape[0]
|
||||
NUM_WORKERS = 128
|
||||
if k_cache.shape[-1] == V41_NVFP4_BYTES_PER_TOKEN:
|
||||
_dequantize_and_gather_k_nvfp4_kernel[(num_reqs, NUM_WORKERS)](
|
||||
# Keep short gathers unchanged; cap total workers for multi-request chunks.
|
||||
num_workers = min(
|
||||
max(128, 2048 // max(1, num_reqs)), max(128, out.shape[1] - offset)
|
||||
)
|
||||
_dequantize_and_gather_k_nvfp4_kernel[(num_reqs, num_workers)](
|
||||
out,
|
||||
out.stride(0),
|
||||
out.stride(1),
|
||||
|
||||
Reference in New Issue
Block a user