Repository navigation
Conversation
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: LeslieWylie <112309453+LeslieWylie@users.noreply.github.com>
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: cohere_compass, qwen3_5, qwen3_5_moe, qwen3_omni_moe, qwen3_vl, qwen3_vl_moe, qwen4_exp |
Contributor
|
Thank you for your contribution 🤗! CI Security Gate — automatic approval blockedThis PR was not automatically approved for CI because the security gate failed. Possible reasons:
See the workflow run for the exact violations. A maintainer can review and manually approve CI if a finding is a false positive. |
YaoleWu
marked this pull request as ready for review
October 19, 2026 10:54
Member
|
looks like code ai slop 😢 |
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.
What does this PR do?
The Qwen3-VL vision RoPE helper converts the entire concatenated Q/K sequence to FP32 and builds full-sequence FP32 products before restoring the input dtype. For long image/video inputs, those temporary tensors grow with the total number of visual tokens.
For the standard
(tokens, heads, head_dim)layout underno_grad, process sequences longer than 4096 rows in chunks and write the results into output tensors with the original dtypes. Each chunk keeps the existing FP32 arithmetic and elementwise operation order. The dense path remains for gradient-enabled execution, short sequences, and other broadcast layouts.The change is defined in the Qwen3-VL modular source. Regenerated copies also update Qwen3-VL-MoE, Qwen3.5, Qwen3.5-MoE, Qwen3-Omni-MoE, Qwen4-Exp, and Cohere-Compass; their helper implementation is identical. No new dependency is required.
Validation
Qwen3VLVisionRotaryEmbeddingTestclass in isolation on CPU with real PyTorch 2.14 and the modified repository module: exact output equality against the unchanged dense Qwen2-VL helper for FP16/BF16, contiguous/noncontiguous inputs, and lengths 4095/4096/4097; gradient equality for the dense training fallback; and FP32 intermediate tensor row bounds throughTorchDispatchMode.torch.compile(..., backend="eager", fullgraph=True, dynamic=True)captures the changed helper for lengths 4097 and 8193 and matches dense outputs. This checks Dynamo fullgraph capture only; Inductor/CUDA were not tested.The repository command for these tests is
pytest tests/models/qwen3_vl/test_modeling_qwen3_vl.py -k Qwen3VLVisionRotaryEmbeddingTest. It was not fully collected in this partial local checkout because unrelated test imports were unavailable; the new unit class was executed directly from that test file.make stylewas attempted but its repository-wide targets include absent directories in this partial checkout. No GPU peak-memory, latency, encoder/model integration (including the derived models), or CUDA backend results are claimed. This is a draft pending those checks and author review.Related work checked: #48105 changes rotary frequency layout, and #47703 changes control-tensor synchronization; neither implements this row-chunked helper.
Code Agent Policy
This draft and its code were prepared with a code agent at the author's explicit request. The author has not yet reviewed this new diff line by line or personally run the reported checks. No maintainer approval is claimed.
Before submitting