Add multi-architecture support to AQUA Shape Recommender#1336
Merged
Conversation
Upgrade shape recommender to support 4 architecture types using strategy pattern: - Text-generation (Llama, Mistral, Qwen, Falcon) - no changes to existing behavior - Multimodal VLMs (LLaVA, Nemotron-VL, Qwen2-VL, InternVL, Phi3-V) - Embedding models (BERT, RoBERTa, E5-Mistral, GTE, ModernBERT) - Audio/ASR (Whisper all sizes) Key changes: - Add ParsedModelConfig with detect_architecture() as single routing point - Add EmbeddingConfig, WhisperConfig, VisionConfig for new architectures - Add memory estimators: VisionMemoryEstimator, EmbeddingMemoryEstimator, WhisperMemoryEstimator - Implement strategy pattern with 4 concrete strategies in new strategies/ package - Add StrategyFactory for architecture-to-strategy routing - Remove text-generation-only gate from _get_model_config() - Add architecture-specific vLLM flags (--limit-mm-per-prompt, --task embedding, etc.) Models previously rejected with "not supported" errors now get proper recommendations. Zero breaking changes - all existing text-generation models work identically. Tested: 9/10 existing tests pass, 1 test has expected behavior change (Whisper now succeeds via new entry point instead of being rejected) Signed-off-by: Aryan Gosaliya <aryan.gosaliya@oracle.com>
…ure support - Add graceful error handling for multimodal models with incomplete sub-configs - Wrap text_config and vision_config parsing in try-except blocks - Allow either text or vision config to succeed for VLMs - Update test_llm_config_unsupported_models to reflect new error messages - Remove obsolete test_which_shapes_valid (replaced by TestNewArchitectures) - All 39 tests in test_recommend.py now pass - New architecture tests (audio, embedding, multimodal): 12/12 passing Signed-off-by: Aryan Gosaliya <aryan.gosaliya@oracle.com>
- 7 Whisper/audio model configs (openai/whisper-*) - 6 embedding model configs (BAAI/bge-*, sentence-transformers/*) - 4 multimodal VLM configs (llava-hf/*, lmms-lab/*) These config.json files are required for TestNewArchitectures tests to pass in GitHub Actions CI/CD workflow. Signed-off-by: Aryan Gosaliya <aryan.gosaliya@oracle.com>
_summarize_shapes_for_seq_lens uses LLMConfig as a type annotation but it was never imported after the V2 refactor, causing a NameError at class definition time and preventing the CLI from loading at all. Signed-off-by: Aryan Gosaliya <aryan.gosaliya@oracle.com>
… strategies Signed-off-by: Aryan Gosaliya <aryan.gosaliya@oracle.com>
mrDzurb
approved these changes
Feb 26, 2026
Member
|
LGTM! |
smfirmin
approved these changes
Feb 26, 2026
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.
Summary
Upgrade shape recommender to support 4 architecture types using strategy pattern: text-generation, multimodal VLMs, embedding models, and audio/ASR.
Changes
New architectures supported:
Key implementation:
ParsedModelConfigwithdetect_architecture()as single routing pointEmbeddingConfig,WhisperConfig,VisionConfigfor new architecturesVisionMemoryEstimator,EmbeddingMemoryEstimator,WhisperMemoryEstimatorstrategies/packageStrategyFactoryfor architecture-to-strategy routing_get_model_config()--limit-mm-per-prompt,--task embedding, etc.)Impact
Testing
test_recommend.py✅TestNewArchitecturespytest tests/unitary/with_extras/aqua/test_recommend.py -vFiles Changed
constants.py,estimator.py,llm_config.py,recommend.py,test_recommend.pystrategies/__init__.py,strategies/base.py,strategies/text.py,strategies/multimodal.py,strategies/embedding.py,strategies/audio.pytest_data/recommend/config-json-files/