Skip to content

[bugfix]: Restore exact Qwen3-VL vision interpolation - #1737

Open
primorLee wants to merge 4 commits into
hao-ai-lab:mainfrom
primorLee:fix/1733-qwen3-vl-vision-parity
Open

[bugfix]: Restore exact Qwen3-VL vision interpolation#1737
primorLee wants to merge 4 commits into
hao-ai-lab:mainfrom
primorLee:fix/1733-qwen3-vl-vision-parity

Conversation

@primorLee

@primorLee primorLee commented Aug 21, 2026

Copy link
Copy Markdown

Summary

Fixes #1733 by restoring exact MiniMax-H3 Qwen3-VL visual position interpolation and bounding its production memory cost.

  • reproduce the Transformers 5.15 bilinear gather, spatial-merge-block ordering, and temporal repetition in native FastVideo code;
  • preserve float32 interpolation weights and accumulation, then cast only at the vision residual-add boundary;
  • process the four-tap gather/product in chunks capped at 64 MiB instead of materializing every packed visual patch at once;
  • release the named float32 forward value after the residual cast;
  • cover realistic image, video, and packed grids with exact and independent references;
  • add a reusable CUDA memory benchmark and record the validation evidence in the H3 local-test guide.

The original contributor commit and attribution are preserved on top of current main.

Dependency contract

FastVideo still supports Transformers 5.0 and newer. The exact Transformers 5.15 interpolation contract is therefore tested through a self-contained slow reference on every supported version. When Transformers 5.15 or newer exposes the public helper, a separate cross-check proves that reference bit-exact. Older supported versions skip only that library cross-check; the exact contract and independent PyTorch interpolation gates still run.

Validation

Exact rebased head:

  • focused Qwen3-VL vision, truncation, and checkpoint-FP8 tests: 46 passed;
  • current Transformers 5.15.1 vision suite: 22 passed;
  • simulated missing public helper: 14 exact contract/PyTorch gates passed and 7 helper-only cross-checks skipped;
  • full 63 GiB production-loader checkpoint gate on NVIDIA GB10: 1 passed in 328.64 seconds;
  • text, image, and video selected layer-50 states versus Transformers 5.15.1: max_abs=0 and mean_abs=0;
  • production video grid [15,42,74] x 1152: incremental CUDA allocation reduced from 1,291,986,432 to 284,866,048 bytes, bit-exact versus the public helper;
  • packed [1,128,224] + [15,42,74] grid: 2,086,086,144 to 418,362,880 bytes with identical float32 output;
  • fresh CPU maximum RSS for the video grid: 2,988,420 to 1,244,088 KiB, removing 1.66 GiB;
  • fp16, bf16, fp32, fp64, merge-size, autograd, default torch.compile, diff, compileall, and commit/trailer checks passed;
  • prescribed pre-commit invocation passed; these model/test/local-test paths are intentionally excluded from the content hooks, and the filename hook passed.

The standing MiniMax-H3 SSIM test is text-only T2VA and does not execute this visual-conditioning path, so no reference reseed is needed. The requested full CI graph remains the external release gate.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to FastVideo! Thanks for your first pull request.

How our CI works:

PRs run a two-tier CI system:

  1. Pre-commit — formatting (yapf), linting (ruff), type checking (mypy). Runs immediately on every PR.
  2. Fastcheck — core GPU tests (encoders, VAEs, transformers, kernels, unit tests). Runs automatically via Buildkite on relevant file changes (~10-15 min).
  3. Full Suite — integration tests, training pipelines, SSIM regression. Runs only when a reviewer adds the ready label.

Before your PR is reviewed:

  • pre-commit run --all-files passes locally
  • You've added or updated tests for your changes
  • The PR description explains what and why

If pre-commit fails, a bot comment will explain how to fix it. Fastcheck and Full Suite results appear in the Checks section below.

Useful links:

@mergify mergify Bot added type: bugfix Bug fix scope: infra CI, tests, Docker, build scope: model Model architecture (DiTs, encoders, VAEs) labels Aug 21, 2026
@mergify

mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI

Protection Waiting on
🔴 PR merge requirements 👀 reviews and 🤖 CI

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=full-suite-passed
  • check-success=fastcheck-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

@primorLee
primorLee marked this pull request as ready for review August 22, 2026 00:57
@primorLee

Copy link
Copy Markdown
Author

CI triage for Buildkite #4973:

  • The encoder lane failed during collection because Hugging Face Hub reset the connection while test_clip_encoder.py was downloading the unrelated hunyuanvideo-community/HunyuanVideo model (LocalEntryNotFoundError). The previous Buildkite #4971 encoder lane passed on this same commit.
  • The unit lane completed 895 tests and its 9 failures are in unrelated API/contract checks (ATTN-QAT capability, schema inventory, CI collection, and FA4 launcher policy); none reference the two files changed here.

This looks independent of the Qwen3-VL interpolation patch. A maintainer rerun should be sufficient for the transient encoder download failure; /test reruns require repository write permission.

@primorLee
primorLee force-pushed the fix/1733-qwen3-vl-vision-parity branch from 5752870 to f20a4e0 Compare August 22, 2026 12:32
@primorLee

Copy link
Copy Markdown
Author

Rebased this single change onto current main (2f3d407) and revalidated the focused regression with Transformers 5.15.0: python -X utf8 -m pytest fastvideo/tests/encoders/test_minimax_h3_qwen3_vl_vision.py -q -> 6 passed. The previous #4973 encoder failure was the unrelated Hugging Face connection reset described above, while #4971's encoder lane passed on the same patch. The new head f20a4e0 should trigger a clean CI run.

@primorLee

Copy link
Copy Markdown
Author

CI update after rebasing onto current main: pre-commit passed, and the PR-relevant Buildkite Encoder Tests lane passed in 13m 9s. The only remaining red lane is the repository-wide microscope Unit Tests job. The preceding run showed those failures in unrelated ATTN-QAT, schema inventory/CI collection, and FA4 policy tests; this PR only changes the Qwen3-VL vision encoder path and its focused regression suite passes 6/6 locally. I have therefore kept this PR scoped and have not mixed unrelated unit-suite repairs into it.

@primorLee
primorLee force-pushed the fix/1733-qwen3-vl-vision-parity branch from f20a4e0 to 9911ab4 Compare August 23, 2026 16:12
@SolitaryThinker
SolitaryThinker force-pushed the fix/1733-qwen3-vl-vision-parity branch from 9911ab4 to 0f1cc9b Compare August 26, 2026 07:32
@SolitaryThinker SolitaryThinker changed the title [bugfix] Fix Qwen3-VL vision interpolation parity [bugfix]: Restore exact Qwen3-VL vision interpolation Aug 26, 2026
@SolitaryThinker

Copy link
Copy Markdown
Collaborator

/merge

@SolitaryThinker

Copy link
Copy Markdown
Collaborator

/test full

@github-actions github-actions Bot added the ready PR is ready to merge label Aug 26, 2026
@SolitaryThinker
SolitaryThinker force-pushed the fix/1733-qwen3-vl-vision-parity branch from 0f1cc9b to 6ded0f7 Compare August 26, 2026 19:06
@SolitaryThinker

Copy link
Copy Markdown
Collaborator

/test full

@SolitaryThinker

Copy link
Copy Markdown
Collaborator

/merge

@github-actions github-actions Bot added ready PR is ready to merge and removed ready PR is ready to merge labels Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready PR is ready to merge scope: infra CI, tests, Docker, build scope: model Model architecture (DiTs, encoders, VAEs) type: bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Qwen3-VL vision tower diverges from transformers 5.15.0: visual-token embeddings mismatch (image/video conditioning parity broken on main)

2 participants