mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-28 16:07:08 +08:00
[Bug] Fix modular_kernel: ZeroDivisionError: integer division or modulo by zero (#26528)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
parent
6e783bc54b
commit
1ee35382cb
@ -717,10 +717,13 @@ class FusedMoEModularKernel(torch.nn.Module):
|
|||||||
get num_chunks == 1. Take max(M, 1) to avoid divide by zero.
|
get num_chunks == 1. Take max(M, 1) to avoid divide by zero.
|
||||||
If there are no tokens to process, the number of chunks will be zero.
|
If there are no tokens to process, the number of chunks will be zero.
|
||||||
"""
|
"""
|
||||||
CHUNK_SIZE = (
|
CHUNK_SIZE = max(
|
||||||
max(M, 1)
|
1,
|
||||||
if not self.fused_experts.supports_chunking()
|
(
|
||||||
else min(M, envs.VLLM_FUSED_MOE_CHUNK_SIZE)
|
M
|
||||||
|
if not self.fused_experts.supports_chunking()
|
||||||
|
else min(M, envs.VLLM_FUSED_MOE_CHUNK_SIZE)
|
||||||
|
),
|
||||||
)
|
)
|
||||||
num_chunks = cdiv(M, CHUNK_SIZE)
|
num_chunks = cdiv(M, CHUNK_SIZE)
|
||||||
# If there are no tokens, then there should be no loop iterations.
|
# If there are no tokens, then there should be no loop iterations.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user