Skip to content

cannot import name 'quantize_' from 'torchao.quantization' (C:\ai\Meissonic\venv\lib\site-packages\torchao\quantization\__init__.py) #1146

@nitinmukesh

Description

@nitinmukesh

What is the issue and how to resolve?

trying to use this
https://github.com/viiika/Meissonic/blob/main/inference_fp8.py

from torchao.quantization.quant_api import (
    quantize_,
    float8_weight_only,
)

pip list

(venv) C:\ai\Meissonic>pip list
Package             Version      Editable project location
------------------- ------------ -------------------------
accelerate          1.0.1
aiofiles            23.2.1
aiohappyeyeballs    2.4.3
aiohttp             3.10.10
aiosignal           1.3.1
annotated-types     0.7.0
anyio               4.6.2.post1
async-timeout       4.0.3
attrs               24.2.0
certifi             2024.8.30
charset-normalizer  3.4.0
click               8.1.7
colorama            0.4.6
diffusers           0.32.0.dev0  C:\ai\Meissonic\diffusers
exceptiongroup      1.2.2
fastapi             0.115.3
ffmpy               0.4.0
filelock            3.16.1
frozenlist          1.5.0
fsspec              2024.10.0
gradio              5.3.0
gradio_client       1.4.2
h11                 0.14.0
httpcore            1.0.6
httpx               0.27.2
huggingface-hub     0.26.1
idna                3.10
importlib_metadata  8.5.0
Jinja2              3.1.4
lightning-utilities 0.11.8
markdown-it-py      3.0.0
MarkupSafe          2.1.5
mdurl               0.1.2
mpmath              1.3.0
multidict           6.1.0
networkx            3.4.2
numpy               1.26.4
orjson              3.10.10
packaging           24.1
pandas              2.2.3
pillow              10.4.0
pip                 22.2.1
propcache           0.2.0
psutil              6.1.0
pydantic            2.9.2
pydantic_core       2.23.4
pydub               0.25.1
Pygments            2.18.0
python-dateutil     2.9.0.post0
python-multipart    0.0.12
pytorch-lightning   2.4.0
pytz                2024.2
PyYAML              6.0.2
regex               2024.9.11
requests            2.32.3
rich                13.9.3
ruff                0.7.0
safetensors         0.4.5
semantic-version    2.10.0
sentencepiece       0.2.0
setuptools          63.2.0
shellingham         1.5.4
six                 1.16.0
sniffio             1.3.1
starlette           0.41.0
sympy               1.13.1
tokenizers          0.20.1
tomlkit             0.12.0
torch               2.5.0+cu124
torchao             0.1
torchmetrics        1.5.1
torchvision         0.20.0+cu124
tqdm                4.66.5
transformers        4.45.2
typer               0.12.5
typing_extensions   4.12.2
tzdata              2024.2
urllib3             2.2.3
uvicorn             0.32.0
websockets          12.0
yarl                1.16.0
zipp                3.20.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions