[BugFix] fix VL fp8 bug when moe token_num is 0#4928
Merged
EmmonsCurse merged 6 commits intoPaddlePaddle:developfrom Nov 12, 2025
Merged
[BugFix] fix VL fp8 bug when moe token_num is 0#4928EmmonsCurse merged 6 commits intoPaddlePaddle:developfrom
EmmonsCurse merged 6 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
EmmonsCurse
approved these changes
Nov 12, 2025
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.
Motivation
多模态模型可能存在仅有文本无图片,或者仅有图片无文本的情况,此时图像Moe或文本Moe会收到一个token_num=0的输入。Triton算子不支持。
Modifications
一种方法是拼接一个长度为1的token vector,不跳过kernel执行,并且在计算完成后切回真实长度。优点是这样理论上Prefill可以跑Cuda Graph,但是缺点是会造成轻微显存增长。
考虑到短期内prefill不需要跑Cuda Graph,现采用token_num=0时跳过执行的修复方式。
Usage or Command
无
Accuracy Tests
无
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.