[Bugfix][CPU] Fix DeepSeek V4.1 import without Triton (#57654)

Signed-off-by: Jiang Wu <245355730+JiangLLM@users.noreply.github.com>
Co-authored-by: Jiang Wu <245355730+JiangLLM@users.noreply.github.com>
This commit is contained in:
Jiang Wu
2026-09-19 05:46:13 +00:00
committed by GitHub
co-authored by Jiang Wu
parent a8d1aa9c99
commit 6af44e2887
3 changed files with 8 additions and 8 deletions
+4 -6
View File
@@ -2,22 +2,20 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import torch
from vllm.triton_utils import HAS_TRITON, tl, triton
from vllm.triton_utils import tl, triton
# Smallest positive value produced by Triton's fp32 `tl.rand`. Used by the
# retained Philox helper for rejection sampling.
#
# Triton requires globals accessed from `@triton.jit` functions to be wrapped
# in `tl.constexpr(...)`. We can only do that when Triton is actually
# available — on the CPU worker path `tl` is a placeholder whose `constexpr`
# attribute is `None`, and `tl.constexpr(...)` would crash at import time.
_TL_RAND_MIN = tl.constexpr(4.6566127342e-10) if HAS_TRITON else 4.6566127342e-10
# in `tl.constexpr(...)`.
_TL_RAND_MIN = tl.constexpr(4.6566127342e-10)
# Offset salt keeping the draft's Gumbel noise disjoint from the target's.
# Verification is a probability-ratio test, not a Gumbel coupling, so a proposal
# and the residual it is resampled from must not share a noise vector.
# Positions are int64 and never approach 2**30, so the streams cannot collide.
_DRAFT_NOISE_SALT = tl.constexpr(1 << 30) if HAS_TRITON else (1 << 30)
_DRAFT_NOISE_SALT = tl.constexpr(1 << 30)
@triton.jit