Skip to content

Commit 48718e3

Browse files
committed
test: add image uri test for huggingface vllm neuronx images
1 parent 8aa1c92 commit 48718e3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/unit/sagemaker/image_uris/test_huggingface_llm.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
"1.8.2": "2.0.1-tei1.8.2-cpu-py310-ubuntu22.04",
3838
},
3939
}
40+
HF_VLLM_VERSIONS_MAPPING = {
41+
"inf2": {
42+
"0.4.1": "0.10.2-neuronx-py310-sdk2.26.0-ubuntu22.04",
43+
},
44+
}
4045
HF_VERSIONS_MAPPING = {
4146
"gpu": {
4247
"0.6.0": "2.0.0-tgi0.6.0-gpu-py39-cu118-ubuntu20.04",
@@ -124,6 +129,30 @@ def test_huggingface_uris(load_config):
124129
assert expected == uri
125130

126131

132+
@pytest.mark.parametrize("load_config", ["huggingface-vllm-neuronx.json"], indirect=True)
133+
def test_huggingface_vllm_neuronx_uris(load_config):
134+
VERSIONS = load_config["inference"]["versions"]
135+
device = load_config["inference"]["processors"][0]
136+
assert device == "inf2"
137+
backend = "huggingface-vllm-neuronx"
138+
139+
# Fail if device is not in mapping
140+
if device not in HF_VLLM_VERSIONS_MAPPING:
141+
raise ValueError(f"Device {device} not found in HF_VLLM_VERSIONS_MAPPING")
142+
for version in VERSIONS:
143+
ACCOUNTS = load_config["inference"]["versions"][version]["registries"]
144+
for region in ACCOUNTS.keys():
145+
uri = get_huggingface_llm_image_uri(backend, region=region, version=version)
146+
expected = expected_uris.huggingface_llm_framework_uri(
147+
"huggingface-vllm-inference-neuronx",
148+
ACCOUNTS[region],
149+
version,
150+
HF_VLLM_VERSIONS_MAPPING[device][version],
151+
region=region,
152+
)
153+
assert expected == uri
154+
155+
127156
@pytest.mark.parametrize(
128157
"load_config", ["huggingface-tei.json", "huggingface-tei-cpu.json"], indirect=True
129158
)

0 commit comments

Comments
 (0)