AML-4269: Add Location Support to Qwen3.5#10
Open
anvdn wants to merge 2 commits into
Open
Conversation
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.
Attention Heatmap Support for Qwen3.5 + refactor
Summary
Extends attention heatmap capture to Qwen3.5 (hybrid linear/full-attention model) and refactors the existing heatmap code so any model can opt in with minimal boilerplate.
Changes
AttentionHeatmapQueryRecorderMixin(hs/attention_heatmap.py): centralizes query-buffer allocation and per-layer query recording. Qwen2-VL, Qwen3-VL, and Qwen3.5 now share this implementation instead of duplicating it.models/qwen3_5.py): full-attention decoder layers now returnq; linear-attention layers are skipped. The model registers itself via the mixin.server_args.py): replaced theattention_heatmap_layer_start/_layer_endrange with a flexibleattention_heatmap_layer_ids: list[int]. This is required for hybrid models where capturable layers aren't contiguous.scheduler_output_processor_mixin.py): when the KV cache is aHybridLinearKVPool, key tensors are looked up viafull_attention_layer_id_mappinginstead of raw layer id. The model now owns the canonical list of recorded layer ids.0.5.11+hs3.