Conversation
shihaobai
self-requested a review
September 18, 2026 15:21
shihaobai
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
GDN prefill 的
fused_gdn_gating_kernel在计算 fp32sigmoid(b)后,先转回输入 dtype,再写入 fp32 的beta_output。输入为 bf16 时,这一步会丢失 beta 的低位精度;后续 chunk GDN 使用的是已舍入的值。相关背景:SGLang issue #38975。修改
beta_output,去掉多余的 bf16 转换。验证
python -m pytest unit_tests/common/basemodel/attention/linear/test_gdn.py unit_tests/common/basemodel/triton_kernel/linear_att/test_fused_gdn_gating.py -q:17 passed(NVIDIA H200)。pre-commit run --files lightllm/common/basemodel/triton_kernel/linear_att/fused_gdn_gating.py unit_tests/common/basemodel/triton_kernel/linear_att/test_fused_gdn_gating.py:Black、flake8 均通过。