[CI] Speed up quantization test group (#53291)
Signed-off-by: Felix Marty <Felix.Marty@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Andreas Karatzas
parent
e7cf4730d6
commit
d1c15e589d
@@ -11,6 +11,7 @@ from vllm.utils.torch_utils import (
|
||||
get_kv_cache_torch_dtype,
|
||||
is_lossless_cast,
|
||||
is_quantized_kv_cache,
|
||||
set_default_torch_dtype,
|
||||
set_torch_threads_for_runtime,
|
||||
startup_omp_num_threads,
|
||||
)
|
||||
@@ -28,6 +29,19 @@ def test_nvfp4_4over6_cache_dtype() -> None:
|
||||
assert get_kv_quant_mode(cache_config.cache_dtype) == KVQuantMode.NVFP4
|
||||
|
||||
|
||||
def test_set_default_torch_dtype_restores_dtype_after_exception() -> None:
|
||||
original_dtype = torch.get_default_dtype()
|
||||
|
||||
with (
|
||||
pytest.raises(RuntimeError, match="expected failure"),
|
||||
set_default_torch_dtype(torch.bfloat16),
|
||||
):
|
||||
assert torch.get_default_dtype() == torch.bfloat16
|
||||
raise RuntimeError("expected failure")
|
||||
|
||||
assert torch.get_default_dtype() == original_dtype
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("src_dtype", "tgt_dtype", "expected_result"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user