Skip to content

[Fix] Align Qwen3.5 tests with Transformers 5.14.1 - #2009

Open
jayhenry wants to merge 3 commits into
InternLM:mainfrom
jayhenry:fix/transformers-5-14-compat-minimal
Open

[Fix] Align Qwen3.5 tests with Transformers 5.14.1#2009
jayhenry wants to merge 3 commits into
InternLM:mainfrom
jayhenry:fix/transformers-5-14-compat-minimal

Conversation

@jayhenry

@jayhenry jayhenry commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR combines the minimal collection workaround from #2008 with the Transformers 5.14.1 compatibility fixes diagnosed in #2002, without migrating the wider test suite away from third-party parametrize.

  • avoid binding the unused Transformers lazy module in test_qwen3_tile_embedding.py
  • call the current Qwen3.5 dense decoder with keyword-only arguments
  • preserve the outer vision boundary around video frame placeholders
  • update Qwen3.5 chat-template expectations for the outer video boundary
  • use the shared Transformers 5.14 vision interpolation helper with FP32 accumulation and a model-dtype result
  • update Qwen3.5 MTP baselines for the current token sequence and fused kernels
  • keep the existing text tolerance and apply the diagnosed tolerance adjustment only to the long image path

Root causes

Collection failure

Third-party parametrize==0.1.1 recursively scans module objects in decorator-frame globals. The top-level transformers lazy module can populate its dictionary during that scan, causing RuntimeError: dictionary changed size during iteration.

The module import in test_qwen3_tile_embedding.py was unused. Importing only the concrete AutoTokenizer symbol avoids exposing the lazy module to this scan while retaining the current parameterization framework.

Transformers 5.14.1 compatibility

  • decoder arguments used by the parity test are now keyword-only
  • current Qwen3/Qwen3.5 processors retain an outer vision boundary when expanding a video into frame placeholders
  • positional interpolation moved to get_vision_bilinear_indices_and_weights
  • the current fused GatedDeltaNet/MoE path introduces bounded numerical drift on the longer image sequence; instrumentation verified bitwise-equal vision output and language-model input before drift accumulates through the language layers
  • chat-template regression strings must include the same outer video boundary

Validation

Using pt29_glm2, variables from zdev/env.sh, and gpu_lock.sh for GPU tests:

  • five model/dataset files: 41 tests collected
  • Qwen3.5 chat-template file: 5 passed
  • Qwen3.5 dense decoder cases plus vision-tower bitwise parity: 3 passed
  • Qwen3.5 standard VL, SP=1/4: 2 passed
  • Qwen3.5 MTP, SP=1/4: 2 passed
  • static audit: no test combines third-party parametrize with module-level import transformers
  • production-file Ruff checks and git diff --check: passed

The previous Action completed with 558 passed, 18 skipped, 1 failed; the sole failure was the stale chat-template expectation fixed by commit 9be88872.

The full local suite was intentionally not run. Full HF video-reference cases require the CI TorchCodec/FFmpeg environment and are covered by the triggered Action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant