-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
[Model] Add ModelConfig class for GraniteMoeHybrid to override default max_seq_len_to_capture #20923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Model] Add ModelConfig class for GraniteMoeHybrid to override default max_seq_len_to_capture #20923
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -200,11 +200,25 @@ def verify_and_update_config(vllm_config: "VllmConfig") -> None: | |||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
class GraniteMoeHybridModelConfig(VerifyAndUpdateConfig): | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
@staticmethod | ||||||||||||||||||||||||
def verify_and_update_config(vllm_config: "VllmConfig") -> None: | ||||||||||||||||||||||||
config = vllm_config.model_config | ||||||||||||||||||||||||
config.max_seq_len_to_capture = config.max_model_len | ||||||||||||||||||||||||
logger.info( | ||||||||||||||||||||||||
"Setting max_seq_len_to_capture to %d " | ||||||||||||||||||||||||
"to ensure that CUDA graph capture " | ||||||||||||||||||||||||
"covers sequences of length up to max_model_len.", | ||||||||||||||||||||||||
config.max_model_len) | ||||||||||||||||||||||||
Comment on lines
+214
to
+218
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a warning log message if
Suggested change
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
MODELS_CONFIG_MAP: dict[str, type[VerifyAndUpdateConfig]] = { | ||||||||||||||||||||||||
"GteModel": SnowflakeGteNewModelConfig, | ||||||||||||||||||||||||
"GteNewModel": GteNewModelConfig, | ||||||||||||||||||||||||
"NomicBertModel": NomicBertModelConfig, | ||||||||||||||||||||||||
"Qwen3ForSequenceClassification": Qwen3ForSequenceClassificationConfig, | ||||||||||||||||||||||||
"XLMRobertaModel": JinaRobertaModelConfig, | ||||||||||||||||||||||||
"JinaVLForRanking": JinaVLForSequenceClassificationConfig, | ||||||||||||||||||||||||
"GraniteMoeHybridForCausalLM": GraniteMoeHybridModelConfig, | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation unconditionally sets
config.max_seq_len_to_capture = config.max_model_len
. Consider checking ifconfig.max_seq_len_to_capture
already has a user-defined value before overriding it. This would prevent unexpected behavior if a user has explicitly configured this value.