Gemma4 31b rope fix and ci#19627
Open
Gasoonjia wants to merge 3 commits into
Open
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19627
Note: Links to docs will display an error until the docs builds have been completed. ❗ 2 Active SEVsThere are 2 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 3 Unclassified FailuresAs of commit 86ba97b with merge base 54f1f28 ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…mma4_31b CI - model.py: strip explanatory comment from materialize_runtime_buffers RoPE inv_freq block (keep hand-rolled formula as-is). - inference.py: revert all hf_validator + quant_compile_validator additions (--use-hf-api / --compare / --compare-quant / --prompts-file flags and their helpers); keep --bf16 HF checkpoint load path and existing prequantized / gguf flows. - .github/workflows/cuda.yml: add SocialLocalMobile/gemma-4-31B-it-HQQ-INT4 matrix entry (prequant tile-packed only) to export-model-cuda-artifact and test-model-cuda-e2e; pin to linux.aws.a100 like qwen3_5_moe. - .ci/scripts/export_model_artifact.sh: add gemma4_31b export branch mirroring qwen3_5_moe pattern. - .ci/scripts/test_model_e2e.sh: add gemma4_31b runner args + tokenizer handling.
d0214b5 to
7cffb3d
Compare
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.
Summary
Currently
materialize_runtime_buffersin model.py was zeroing out ALL meta buffers, including each layer's inv_freq (RoPE frequencies). The follow-upattn.inv_freq.to(device)was a no-op on already-zero tensors. So RoPE produced cos=1, sin=0 for every position → model had NO positional information → introduce the period-N echo cycle pattern.This PR fix the issue by recomputing inv_freq per-layer with real values (using the layer's head_dim, partial_rotary, rope_theta, is_sliding flag) in materialize_runtime_buffers.
Test plan
Add e2e ci for gemma4-31b model and check its output.