[Tests] Delete deprecate torchao tests for v1 configs (#52956)
Signed-off-by: andrewor14 <andrewor14@gmail.com>
andrewor14 committed
Sep 16, 2026 at 19:11 UTC
62f948258385418ed248d5cdfceab4d29c1b5bfd
1 file changed
-60
tests/quantization/test_torchao.py
-60
@@ -9,7 +9,6 @@ from packaging import version
9
10
from tests.quantization.utils import load_model_without_vllm_runner
11
from vllm.config import set_current_vllm_config
12
-from vllm.config.load import LoadConfig
12
from vllm.forward_context import set_forward_context
13
from vllm.model_executor.layers.attention import Attention
14
from vllm.model_executor.model_loader import get_model_loader
@@ -67,65 +66,6 @@ def test_pre_quantized_model(monkeypatch, dist_init, workspace_init):
66
assert torch.isfinite(logits).all()
67
68
70
-@pytest.mark.skipif(not TORCHAO_AVAILABLE, reason="torchao is not available")
71
-@pytest.mark.parametrize(
72
- "pt_load_map_location",
73
- [
74
- f"{DEVICE_TYPE}:0",
75
- # {"": "cuda"},
76
- ],
77
-)
78
-def test_opt_125m_int8wo_model_loading_with_params(
79
- pt_load_map_location, monkeypatch, dist_init, workspace_init
80
-):
81
- torch._dynamo.reset()
82
- model_name = "jerryzh168/opt-125m-int8wo-partial-quant"
83
- model, vllm_config = load_model_without_vllm_runner(
84
- model_name,
85
- quantization="torchao",
86
- vllm_config_kwargs={
87
- "load_config": LoadConfig(pt_load_map_location=pt_load_map_location)
88
- },
89
- )
90
-
91
- monkeypatch.setattr(Attention, "forward", lambda _, q, k, v: q.contiguous())
92
- input_ids = torch.tensor([1, 2, 3, 4], device=DEVICE_TYPE)
93
- positions = torch.arange(input_ids.numel(), device=DEVICE_TYPE)
94
- with (
95
- set_current_vllm_config(vllm_config),
96
- set_forward_context(None, vllm_config, num_tokens=input_ids.numel()),
97
- ):
98
- hidden_states = model(input_ids, positions, None)
99
- logits = model.compute_logits(hidden_states)
100
- assert torch.isfinite(logits).all()
101
-
102
-
103
-@pytest.mark.skipif(not TORCHAO_AVAILABLE, reason="torchao is not available")
104
-def test_qwenvl_int8wo_model_loading_with_params(
105
- monkeypatch, dist_init, workspace_init
106
-):
107
- torch._dynamo.reset()
108
- model_name = "mobicham/Qwen2.5-VL-3B-Instruct_int8wo_ao"
109
- model, vllm_config = load_model_without_vllm_runner(
110
- model_name,
111
- quantization="torchao",
112
- vllm_config_kwargs={
113
- "load_config": LoadConfig(pt_load_map_location=f"{DEVICE_TYPE}:0")
114
- },
115
- )
116
-
117
- monkeypatch.setattr(Attention, "forward", lambda _, q, k, v: q.contiguous())
118
- input_ids = torch.tensor([1, 2, 3, 4], device=DEVICE_TYPE)
119
- positions = torch.arange(input_ids.numel(), device=DEVICE_TYPE).expand(3, -1)
120
- with (
121
- set_current_vllm_config(vllm_config),
122
- set_forward_context(None, vllm_config, num_tokens=input_ids.numel()),
123
- ):
124
- hidden_states = model(input_ids, positions, None)
125
- logits = model.compute_logits(hidden_states)
126
- assert torch.isfinite(logits).all()
127
-
128
-
69
@pytest.mark.skipif(not TORCHAO_AVAILABLE, reason="torchao is not available")
70
@pytest.mark.skip(
71
reason="since torchao nightly is only compatible with torch nightly"