|
37 | 37 | "1.8.2": "2.0.1-tei1.8.2-cpu-py310-ubuntu22.04", |
38 | 38 | }, |
39 | 39 | } |
| 40 | +HF_VLLM_VERSIONS_MAPPING = { |
| 41 | + "inf2": { |
| 42 | + "0.4.1": "0.10.2-neuronx-py310-sdk2.26.0-ubuntu22.04", |
| 43 | + }, |
| 44 | +} |
40 | 45 | HF_VERSIONS_MAPPING = { |
41 | 46 | "gpu": { |
42 | 47 | "0.6.0": "2.0.0-tgi0.6.0-gpu-py39-cu118-ubuntu20.04", |
@@ -124,6 +129,30 @@ def test_huggingface_uris(load_config): |
124 | 129 | assert expected == uri |
125 | 130 |
|
126 | 131 |
|
| 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 | + |
127 | 156 | @pytest.mark.parametrize( |
128 | 157 | "load_config", ["huggingface-tei.json", "huggingface-tei-cpu.json"], indirect=True |
129 | 158 | ) |
|
0 commit comments