fix(iluvatar): correct HD128 paged prefill dispatch - #990
Open
gongchensu wants to merge 1 commit into
Open
gongchensu wants to merge 1 commit into
gongchensu wants to merge 1 commit into
Conversation
Use the existing InfiniOps global warp kernel for Iluvatar HD128 prefill while preserving other backends dispatch. Fold query-token counts above 65535 into grid.z to support large batches. Add ChatGLM3 and MiniCPM4 regression coverage, HD128 smoke coverage, and grid-boundary tests. Both model issues share the same prefill fix.
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.
Use the existing InfiniOps global warp kernel for Iluvatar HD128 prefill while preserving other backends dispatch. Fold query-token counts above 65535 into grid.z to support large batches.
Add ChatGLM3 and MiniCPM4 regression coverage, HD128 smoke coverage, and grid-boundary tests. Both model issues share the same prefill fix.
Summary
src/native/cuda/ops/paged_attention_prefill_infinilm/kernel.h, avoiding the incorrect HD128 pipeline path on Iluvatar.grid.zfor Iluvatar so large batch prefill launches stay within CUDA grid limits.tests/test_flash_attn_varlen_func.py.tests/conftest.py.65535,65536, and131071.Motivation
The Iluvatar HD128 pipeline path produced incorrect paged prefill results for ChatGLM3 and MiniCPM4. For the ChatGLM3-shaped HD128 case, the original path had a maximum error around
4.611; using the existing global warp kernel reduces it to about0.000967.Large batch prefill also placed the total query-token count directly in
grid.y, so workloads such as batch 16 with input length 4096 exceeded CUDA's 65535grid.ylimit. The global warp kernel already supports folding the extra tokens intogrid.z; this PR enables that launch geometry only for Iluvatar.No linked issue is available yet; reproducers and automated regression coverage are included in this PR.
Type of Change
feat— new feature / new operator / new platformfix— bug fixperf— performance improvement (no behavioral change)refactor— code restructuring without behavior changetest— adding or fixing tests onlydocs— documentation onlybuild/ci— build system or CI configurationchore— tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Smoke Test Result
Test Results on Supported Platforms
Full `pytest` output (optional)
Benchmark / Performance Impact
Notes for Reviewers