Skip to content

Commit 2c11f9c

Browse files
authored
chore: upgrade sgl-kernel 0.0.9.post2 (#5540)
1 parent a6f892e commit 2c11f9c

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ runtime_common = [
4747

4848
srt = [
4949
"sglang[runtime_common]",
50-
"sgl-kernel==0.0.9.post1",
50+
"sgl-kernel==0.0.9.post2",
5151
"flashinfer_python==0.2.3",
5252
"torch==2.5.1",
5353
"torchvision==0.20.1",

python/sglang/srt/layers/sampler.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,21 @@ def forward(
9393
).clamp(min=torch.finfo(probs.dtype).min)
9494

9595
max_top_k_round, batch_size = 32, probs.shape[0]
96-
uniform_samples = torch.rand(
97-
(max_top_k_round, batch_size), device=probs.device
98-
)
9996
if sampling_info.need_min_p_sampling:
10097
probs = top_k_renorm_prob(probs, sampling_info.top_ks)
10198
probs = top_p_renorm_prob(probs, sampling_info.top_ps)
10299
batch_next_token_ids = min_p_sampling_from_probs(
103-
probs, uniform_samples, sampling_info.min_ps
100+
probs, sampling_info.min_ps
104101
)
105102
else:
106-
batch_next_token_ids, success = top_k_top_p_sampling_from_probs(
103+
batch_next_token_ids = top_k_top_p_sampling_from_probs(
107104
probs,
108-
uniform_samples,
109105
sampling_info.top_ks,
110106
sampling_info.top_ps,
111107
filter_apply_order="joint",
112108
)
113109

114-
if self.use_nan_detection and not torch.all(success):
110+
if self.use_nan_detection:
115111
logger.warning("Detected errors during sampling!")
116112
batch_next_token_ids = torch.zeros_like(batch_next_token_ids)
117113

scripts/ci_install_dependency.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pip install --upgrade pip
2020

2121
# Install flashinfer and sgl-kernel
2222
pip install flashinfer_python==0.2.3 --find-links ${FLASHINFER_REPO} --no-cache-dir
23-
pip install sgl-kernel==0.0.9.post1 --no-cache-dir
23+
pip install sgl-kernel==0.0.9.post2 --no-cache-dir
2424

2525
# Install the main package
2626
pip install -e "python[all]" --find-links ${FLASHINFER_REPO}

0 commit comments

Comments
 (0)