Skip to content

Commit 3bded6f

Browse files
committed
include torchao in CI
Signed-off-by: Jerry Zhang <[email protected]>
1 parent d65d676 commit 3bded6f

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.buildkite/test-pipeline.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ steps:
420420
- vllm/model_executor/layers/quantization
421421
- tests/quantization
422422
commands:
423+
# temporary install here since we need nightly, will move to requirements/test.in
424+
# after torchao 0.12 release
425+
- pip install --pre torchao --index-url https://download.pytorch.org/whl/nightly/cu126
423426
- VLLM_TEST_FORCE_LOAD_FORMAT=auto pytest -v -s quantization
424427

425428
- label: LM Eval Small Models # 53min

vllm/model_executor/layers/quantization/torchao.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from vllm.model_executor.layers.quantization.base_config import (
1414
QuantizationConfig, QuantizeMethodBase)
1515
from vllm.model_executor.utils import set_weight_attrs
16+
from vllm.utils import is_torch_equal_or_newer
1617

1718
logger = init_logger(__name__)
1819

@@ -22,13 +23,18 @@ class TorchAOConfig(QuantizationConfig):
2223

2324
def __init__(self, torchao_config) -> None:
2425
self.torchao_config = torchao_config
25-
# TODO (jerryzh168): enable after 2.8.0
2626
# TorchAO quantization relies on tensor subclasses. In order,
2727
# to enable proper caching this needs standalone compile
28-
# os.environ["VLLM_TEST_STANDALONE_COMPILE"] = "1"
29-
# logger.info("Using TorchAO: Setting VLLM_TEST_STANDALONE_COMPILE=1")
30-
os.environ["VLLM_DISABLE_COMPILE_CACHE"] = "1"
31-
logger.info("Using TorchAO: Setting VLLM_DISABLE_COMPILE_CACHE=1")
28+
if is_torch_equal_or_newer("2.8.0"):
29+
os.environ["VLLM_TEST_STANDALONE_COMPILE"] = "1"
30+
logger.info(
31+
"Using TorchAO: Setting VLLM_TEST_STANDALONE_COMPILE=1")
32+
33+
# TODO: remove after the torch dependency is updated to 2.8
34+
if is_torch_equal_or_newer(
35+
"2.7.0") and not is_torch_equal_or_newer("2.8.0"):
36+
os.environ["VLLM_DISABLE_COMPILE_CACHE"] = "1"
37+
logger.info("Using TorchAO: Setting VLLM_DISABLE_COMPILE_CACHE=1")
3238

3339
def __repr__(self) -> str:
3440
return f"TorchAOConfig({self.torchao_config})"

0 commit comments

Comments
 (0)