-
Notifications
You must be signed in to change notification settings - Fork 47
Enhance the container family validation for multi-model deployment #1148
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
|
||
from ads.aqua.common.entities import GPUShapesIndex | ||
from ads.aqua.common.enums import ( | ||
CONTAINER_FAMILY_COMPATIBILITY, | ||
InferenceContainerParamType, | ||
InferenceContainerType, | ||
RqsAdditionalDetails, | ||
|
@@ -1316,3 +1317,40 @@ def load_gpu_shapes_index( | |
) | ||
|
||
return GPUShapesIndex(**data) | ||
|
||
|
||
def get_preferred_compatible_family(selected_families: set[str]) -> str: | ||
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. nit: use |
||
""" | ||
Determines the preferred container family from a given set of container families. | ||
|
||
This method is used in the context of multi-model deployment to handle cases | ||
where models selected for deployment use different, but compatible, container families. | ||
|
||
It checks the input `families` set against the `CONTAINER_FAMILY_COMPATIBILITY` map. | ||
If a compatibility group exists that fully includes all the families in the input, | ||
the corresponding key (i.e., the preferred family) is returned. | ||
|
||
Parameters | ||
---------- | ||
families : set[str] | ||
A set of container family identifiers. | ||
|
||
Returns | ||
------- | ||
Optional[str] | ||
The preferred container family if all families are compatible within one group; | ||
otherwise, returns `None` indicating that no compatible family group was found. | ||
|
||
Example | ||
------- | ||
>>> get_preferred_compatible_family({"odsc-vllm-serving", "odsc-vllm-serving-v1"}) | ||
'odsc-vllm-serving-v1' | ||
|
||
>>> get_preferred_compatible_family({"odsc-vllm-serving", "odsc-tgi-serving"}) | ||
None # Incompatible families | ||
""" | ||
for preferred, compatible_list in CONTAINER_FAMILY_COMPATIBILITY.items(): | ||
if selected_families.issubset(set(compatible_list)): | ||
return preferred | ||
|
||
return None |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*-- | ||
|
||
# Copyright (c) 2025 Oracle and/or its affiliates. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ | ||
|
||
import pytest | ||
from ads.aqua.common.utils import get_preferred_compatible_family | ||
|
||
|
||
class TestCommonUtils: | ||
@pytest.mark.parametrize( | ||
"input_families, expected", | ||
[ | ||
( | ||
{"odsc-vllm-serving", "odsc-vllm-serving-v1"}, | ||
"odsc-vllm-serving-v1", | ||
), | ||
({"odsc-tgi-serving", "odsc-vllm-serving"}, None), | ||
({"non-existing-one", "odsc-tgi-serving"}, None), | ||
], | ||
) | ||
def test_get_preferred_compatible_family(self, input_families, expected): | ||
assert get_preferred_compatible_family(input_families) == expected |
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.
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.
Is there specific reason why we have chosen
odsc-vllm-v1
as key and notodsc-vllm
?If i understand correctly , if 2 or more models are chosen with some models compatible with
odsc-vllm-v1
and others withodsc-vllm
, the group will be deployed withodsc-vllm-v1
. and if all selected models are compatible withodsc-vllm
, we still go ahead and deploy withodsc-vllm-v1
?Correct me if am wrong. @mrDzurb
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.
I see.
I believe odsc-vllm-v1 is preferred in both the cases.
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.
There is no perfect solution for this, in my opinion. Ideally, we would re-test all service models and update them to use the latest container, but that would be too time consuming. For now, this is just a best-effort attempt to choose the most recent container family when models from different families are mixed. Hopefully, VLLM will continue to improve, and the enhancement introduced in this PR will be more robust.