Skip to content

Add component-aware proxy support for image-text models - #1505

Open
Mamta Singh (quic-mamta) wants to merge 22 commits into
qualcomm:mainfrom
quic-mamta:proxy_image_text
Open

Mamta Singh (quic-mamta) wants to merge 22 commits into
qualcomm:mainfrom
quic-mamta:proxy_image_text

Conversation

@quic-mamta

@quic-mamta Mamta Singh (quic-mamta) commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds component-aware proxy support for image-text models.

This extends image-text proxy loading with a proxy_component selector that defaults to "language" to preserve current behavior, while enabling "vision" proxy reduction for supported VLM vision stacks.

Changes

  • Add proxy_component={"language", "vision"} handling for image-text proxy loading.
  • Keep existing causal and language proxy behavior unchanged by default.
  • Add vision proxy reduction policy supporting:
    • vision_config.depth
    • vision_config.num_hidden_layers
    • vision_config.vt_num_hidden_layers
  • Normalize layer-indexed vision metadata after proxy reduction, including:
    • deep-stack visual indexes
    • full-attention block indexes
    • cross-attention layer lists
    • intermediate/out layer index arrays
  • Make proxy state and hash metadata component-aware:
    • proxy_component
    • proxy_num_hidden_layers
    • proxy_num_vision_layers
  • Split dual-QPC image-text proxy state so only the selected component is proxy-enabled.
  • Prevent vision proxy mode from applying language embedding / lm_head substitutions.
  • Make proxy ONNX subfunction validation component-aware.
  • Add compatibility fallbacks for local Transformers API differences:
    • GraniteMoe GraniteMoeParallelExperts / GraniteMoeTopKGating renames
    • Pixtral position_ids_in_meshgrid absence

Notes

  • When enable_proxy=True is used for image-text models and proxy_component is omitted, proxying remains language-only for backward compatibility.
  • Vision proxy can be enabled explicitly via proxy_component="vision".
  • Component-aware image-text proxy also works with weight_free=True in supported dual-QPC VLM mode; single-QPC weight-free remains unsupported.

Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <168400541+quic-mamta@users.noreply.github.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>

@quic-mamta Mamta Singh (quic-mamta) left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed the review comments from qeff-pro-review.

Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <168400541+quic-mamta@users.noreply.github.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>

Copilot AI 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.

🟡 Changes recommended

Deduplicating feature-selection indexes and export targets breaks Mllama projection dimensions and Dynamo’s ordered naming contract, with additional proxy normalization and vision-validation issues unresolved.

6 open issues
What changed in this PR

Adds component-aware proxy loading to QEfficient’s image-text pipeline, allowing vision-stack reduction while keeping language proxy mode as the default.

Changes:

  • Adds a proxy_component selector and vision-depth reduction with layer-metadata normalization.
  • Makes component transforms, artifact hashes, logits handling, and ONNX subfunction selection component-aware.
  • Adds focused regression tests and documents vision proxy usage.
File Description
tests/​unit_test/​models/​test_model_quickcheck.py Adds component-selection, metadata-normalization, and loading regression tests.
QEfficient/​utils/​export_utils.py Selects and validates ONNX subfunctions for the chosen component.
QEfficient/​transformers/​models/​modeling_auto.py Propagates component selection through loaders and dual-QPC wrappers.
QEfficient/​transformers/​modeling_utils.py Limits language substitutions to language proxy mode.
QEfficient/​proxy/​modeling_utils.py Adds vision reduction and layer-metadata normalization policies.
QEfficient/​generation/​generation_helpers.py Restricts proxy logits-width handling to language mode.
QEfficient/​base/​modeling_qeff.py Adds component and reduced-depth metadata to artifact hashes.
docs/​source/​features_enablement.md Documents vision proxy behavior and configuration.

Review effort: Balanced

Comment thread QEfficient/proxy/modeling_utils.py Resolved
Comment thread QEfficient/utils/export_utils.py Resolved
Comment thread QEfficient/proxy/modeling_utils.py Resolved
Comment thread QEfficient/proxy/modeling_utils.py Resolved
Comment thread QEfficient/proxy/modeling_utils.py Resolved
Comment thread QEfficient/utils/export_utils.py Resolved
@quic-mamta
Mamta Singh (quic-mamta) force-pushed the proxy_image_text branch 2 times, most recently from 27f87eb to bb83f74 Compare November 25, 2026 08:45
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>

Copilot AI 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.

Comment thread QEfficient/proxy/modeling_utils.py Resolved
Comment thread QEfficient/proxy/modeling_utils.py Resolved
Comment thread QEfficient/utils/export_utils.py Resolved
Comment thread QEfficient/proxy/modeling_utils.py Resolved
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <mamtsing@qti.qualcomm.com>
Signed-off-by: Mamta Singh <168400541+quic-mamta@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

2 participants