Files
project_6/qwen3_6_scripts
Claude a7bedb33ee fix(CRITICAL): patch qwen2_vl vision attention — bypass xops varlen_fwd on BI-V100
Previous xformers.py fix only covered our attention backend. The crash
moved to qwen2_vl.py's Qwen2VisionAttention.forward (base image file)
which directly calls xops.memory_efficient_attention_forward during
profiling's _process_image_input → visual() → block.attn().

Fix: monkey-patch Qwen2VisionAttention.forward at import time to use
the same PyTorch F.scaled_dot_product_attention path that qwen2_vl.py
already has for CPU (is_cpu() branch). This is the exact same math,
just without xops dispatch to ixformer's broken varlen_fwd.

Also added try/except fallback in _process_image_input for safety.
2026-08-11 13:09:10 +00:00
..