Skip to content

Commit 19dc3e8

Browse files
committed
v0.37.1
See https://github.com/quic/ai-hub-models/releases/v0.37.1 for changelog. Signed-off-by: QAIHM Team <[email protected] >
1 parent 660512a commit 19dc3e8

File tree

17 files changed

+49
-42
lines changed

17 files changed

+49
-42
lines changed

qai_hub_models/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# SPDX-License-Identifier: BSD-3-Clause
44
# ---------------------------------------------------------------------
55

6-
__version__ = "0.37.0"
6+
__version__ = "0.37.1"

qai_hub_models/global_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ filelock>=3.16.1
2828
ftfy==6.1.1
2929
gdown==4.7.1
3030
gitpython==3.1.42
31-
huggingface_hub>=0.23.1,<1.0
31+
huggingface_hub>=0.34.0,<1.0
3232
hydra-core==1.3.0
3333
imageio[ffmpeg]==2.31.5
3434
imagesize==1.4.1

qai_hub_models/models/_shared/llm/export_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ def fetch_context_binaries(
491491
# Download each component's context binary.
492492
for component in components:
493493
link_job = component.link_job
494-
assert link_job is not None and link_job.get_status().success
495-
target_model_filename = f"{model_name}_{component.name}.bin"
494+
assert link_job is not None and link_job.wait().success
495+
target_model_filename = f"{model_name}_{component.name(len(components))}.bin"
496496
target_model_list.append(target_model_filename)
497497
cast(hub.Model, link_job.get_target_model()).download(
498498
str(output_path / target_model_filename)
@@ -522,7 +522,7 @@ def print_subcomponent_profile_metrics(
522522
AssertionError if the profile job failed.
523523
"""
524524
profile_job = component.subcomponent_profile_job[instantiation_type]
525-
if not profile_job.get_status().success:
525+
if not profile_job.wait().success:
526526
print(
527527
f"Profile job for {component.subcomponent_name(instantiation_type, num_components=num_components)} failed:\n"
528528
f" {profile_job.get_status().message}"

qai_hub_models/models/_shared/stable_diffusion/model.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55

66
from __future__ import annotations
77

8+
from typing import TYPE_CHECKING
9+
810
# isort: off
911
# This verifies aimet is installed, and this must be included first.
1012
from qai_hub_models.utils.quantization_aimet_onnx import (
1113
AIMETOnnxQuantizableMixin,
12-
ensure_max_aimet_onnx_version,
1314
)
1415

1516
# isort: on
@@ -19,9 +20,11 @@
1920

2021
import diffusers
2122
import torch
22-
from aimet_common.defs import QuantScheme
23-
from aimet_onnx.quantsim import QuantizationSimModel as QuantSimOnnx
24-
from aimet_onnx.quantsim import load_encodings_to_sim
23+
24+
if TYPE_CHECKING:
25+
from aimet_onnx.quantsim import QuantizationSimModel as QuantSimOnnx
26+
27+
2528
from diffusers import AutoencoderKL, UNet2DConditionModel
2629
from diffusers.schedulers.scheduling_utils import SCHEDULER_CONFIG_NAME
2730
from huggingface_hub import hf_hub_download
@@ -48,9 +51,9 @@
4851
)
4952
from qai_hub_models.utils.input_spec import InputSpec
5053
from qai_hub_models.utils.qai_hub_helpers import ensure_v73_or_later
54+
from qai_hub_models.utils.quantization_aimet_onnx import ensure_max_aimet_onnx_version
5155

5256
MAX_AIMET_ONNX_VERSION = "2.6.0"
53-
ensure_max_aimet_onnx_version(MAX_AIMET_ONNX_VERSION)
5457

5558

5659
class TextEncoderBase(BaseModel, FromPretrainedMixin):
@@ -108,6 +111,11 @@ def from_pretrained(
108111
Create AimetQuantSim from checkpoint. QuantSim is calibrated if the
109112
checkpoint is an AIMET_ONNX_EXPORT or DEFAULT
110113
"""
114+
ensure_max_aimet_onnx_version(MAX_AIMET_ONNX_VERSION, cls.model_id)
115+
from aimet_common.defs import QuantScheme
116+
from aimet_onnx.quantsim import QuantizationSimModel as QuantSimOnnx
117+
from aimet_onnx.quantsim import load_encodings_to_sim
118+
111119
host_device = torch.device(host_device)
112120
subfolder = subfolder or cls.default_subfolder
113121
onnx_model, aimet_encodings = cls.onnx_from_pretrained(
@@ -227,6 +235,11 @@ def from_pretrained(
227235
Create AimetQuantSim from checkpoint. QuantSim is calibrated if the
228236
checkpoint is an AIMET_ONNX_EXPORT or DEFAULT
229237
"""
238+
ensure_max_aimet_onnx_version(MAX_AIMET_ONNX_VERSION, cls.model_id)
239+
from aimet_common.defs import QuantScheme
240+
from aimet_onnx.quantsim import QuantizationSimModel as QuantSimOnnx
241+
from aimet_onnx.quantsim import load_encodings_to_sim
242+
230243
host_device = torch.device(host_device)
231244
subfolder = subfolder or cls.default_subfolder
232245
onnx_model, aimet_encodings = cls.onnx_from_pretrained(
@@ -324,6 +337,11 @@ def from_pretrained(
324337
Create AimetQuantSim from checkpoint. QuantSim is calibrated if the
325338
checkpoint is an AIMET_ONNX_EXPORT or DEFAULT
326339
"""
340+
ensure_max_aimet_onnx_version(MAX_AIMET_ONNX_VERSION, cls.model_id)
341+
from aimet_common.defs import QuantScheme
342+
from aimet_onnx.quantsim import QuantizationSimModel as QuantSimOnnx
343+
from aimet_onnx.quantsim import load_encodings_to_sim
344+
327345
host_device = torch.device(host_device)
328346
subfolder = subfolder or cls.default_subfolder
329347
onnx_model, aimet_encodings = cls.onnx_from_pretrained(

qai_hub_models/models/falcon_v3_7b_instruct/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aimet-onnx==2.10.0; sys_platform == 'linux' and python_version == "3.10"
22
transformers==4.45.0
3-
huggingface_hub==0.23.2
43
sentencepiece==0.2.0
54
psutil
65
onnx==1.16.2

qai_hub_models/models/llama_v3_1_8b_instruct/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aimet-onnx==2.10.0; sys_platform == 'linux' and python_version == "3.10"
22
transformers==4.45.0
3-
huggingface_hub==0.23.2
43
sentencepiece==0.2.0
54
psutil
65
onnx==1.16.2

qai_hub_models/models/llama_v3_1_sea_lion_3_5_8b_r/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aimet-onnx==2.10.0; sys_platform == 'linux' and python_version == "3.10"
22
transformers==4.45.0
3-
huggingface_hub==0.23.2
43
sentencepiece==0.2.0
54
psutil
65
onnx==1.16.2

qai_hub_models/models/llama_v3_2_1b_instruct/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aimet-onnx==2.10.0; sys_platform == 'linux' and python_version == "3.10"
22
transformers==4.45.0
3-
huggingface_hub==0.23.2
43
sentencepiece==0.2.0
54
psutil
65
onnx==1.16.2

qai_hub_models/models/llama_v3_2_3b_instruct/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aimet-onnx==2.10.0; sys_platform == 'linux' and python_version == "3.10"
22
transformers==4.45.0
3-
huggingface_hub==0.23.2
43
sentencepiece==0.2.0
54
psutil
65
onnx==1.16.2

qai_hub_models/models/llama_v3_8b_instruct/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aimet-onnx==2.10.0; sys_platform == 'linux' and python_version == "3.10"
22
transformers==4.45.0
3-
huggingface_hub==0.23.2
43
sentencepiece==0.2.0
54
psutil
65
onnx==1.16.2

0 commit comments

Comments
 (0)