| |
| |
|
|
| |
| |
|
|
| import pytest |
|
|
| from tests.quantization.utils import is_quant_method_supported |
|
|
| from ..utils import compare_two_settings |
|
|
|
|
| @pytest.mark.skipif( |
| not is_quant_method_supported("fp8"), |
| reason="fp8 is not supported on this GPU type.", |
| ) |
| def test_cpu_offload_fp8(): |
| |
| compare_two_settings( |
| "neuralmagic/Qwen2-1.5B-Instruct-FP8", |
| ["--enforce_eager"], |
| ["--enforce_eager", "--cpu-offload-gb", "1"], |
| max_wait_seconds=480, |
| ) |
|
|
|
|
| @pytest.mark.skipif( |
| not is_quant_method_supported("gptq_marlin"), |
| reason="gptq_marlin is not supported on this GPU type.", |
| ) |
| def test_cpu_offload_gptq(monkeypatch): |
| |
| monkeypatch.setenv("VLLM_TEST_FORCE_LOAD_FORMAT", "auto") |
| |
| compare_two_settings( |
| "Qwen/Qwen2-1.5B-Instruct-GPTQ-Int4", |
| ["--enforce_eager"], |
| ["--enforce_eager", "--cpu-offload-gb", "1"], |
| max_wait_seconds=480, |
| ) |
|
|
|
|
| @pytest.mark.skipif( |
| not is_quant_method_supported("awq_marlin"), |
| reason="awq_marlin is not supported on this GPU type.", |
| ) |
| def test_cpu_offload_awq(monkeypatch): |
| |
| monkeypatch.setenv("VLLM_TEST_FORCE_LOAD_FORMAT", "auto") |
| |
| compare_two_settings( |
| "Qwen/Qwen2-1.5B-Instruct-AWQ", |
| ["--enforce_eager"], |
| ["--enforce_eager", "--cpu-offload-gb", "1"], |
| max_wait_seconds=480, |
| ) |
|
|
|
|
| @pytest.mark.skipif( |
| not is_quant_method_supported("gptq_marlin"), |
| reason="gptq_marlin is not supported on this GPU type.", |
| ) |
| def test_cpu_offload_compressed_tensors(monkeypatch): |
| |
| monkeypatch.setenv("VLLM_TEST_FORCE_LOAD_FORMAT", "auto") |
| |
| compare_two_settings( |
| "nm-testing/Qwen1.5-MoE-A2.7B-Chat-quantized.w4a16", |
| ["--enforce_eager"], |
| ["--enforce_eager", "--cpu-offload-gb", "1"], |
| max_wait_seconds=480, |
| include_seeded_sampling=False, |
| ) |
|
|