---
id: pr-sglang-5546
repo: sgl-project/sglang
pr: 5546
title: Fix sampler nan check when calling top_k_top_p_sampling_from_probs
author: yubofredwang
date: '2025-04-20'
url: https://github.com/sgl-project/sglang/pull/5546
source_category: upstream-code
architectures:
- sm100
tags:
- gemm
techniques: []
hardware_features: []
kernel_types: []
languages:
- python
captured_at: '2026-04-27'
status: merged
merge_sha: 20f1c8e3748f4b28f209f1cf62b2ffcf075810c5
inclusion_reason: kernel file changes
changed_paths:
- python/sglang/srt/layers/sampler.py
- sgl-kernel/python/sgl_kernel/sampling.py
head_ref_oid: 910ce92cd83b48748f124326320e6a57d17fd86c
artifact_dir: evidence/pull-bundles/sglang/gh-5546
---
# Fix sampler nan check when calling top_k_top_p_sampling_from_probs

- Repository: `sgl-project/sglang`
- PR: [5546](https://github.com/sgl-project/sglang/pull/5546)
- Decision: `kernel file changes`
- Reason: kernel file changes

## Changed Paths

- `python/sglang/srt/layers/sampler.py`
- `sgl-kernel/python/sgl_kernel/sampling.py`

## Evidence Bundle

`evidence/pull-bundles/sglang/gh-5546`
