A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Bugfix] fix custom op test (#25429)
Signed-off-by: Luka Govedič <lgovedic@redhat.com>
Luka Govedič committed
Sep 22, 2025 at 20:07 UTC
d588cd24061011f76da721c89f9e2171a2b2c4c8
1 file changed
+12
-10
tests/model_executor/test_enabled_custom_ops.py
+12
-10
@@ -1,5 +1,6 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+from typing import Optional
4
5
import pytest
6
import torch
@@ -34,15 +35,15 @@ class Relu3(ReLUSquaredActivation):
35
[
36
# Default values based on compile level
37
# - All by default (no Inductor compilation)
37
- ("", 0, False, [True] * 4, True),
38
- ("", 1, True, [True] * 4, True),
39
- ("", 2, False, [True] * 4, True),
38
+ (None, 0, False, [True] * 4, True),
39
+ (None, 1, True, [True] * 4, True),
40
+ (None, 2, False, [True] * 4, True),
41
# - None by default (with Inductor)
41
- ("", 3, True, [False] * 4, False),
42
- ("", 4, True, [False] * 4, False),
42
+ (None, 3, True, [False] * 4, False),
43
+ (None, 4, True, [False] * 4, False),
44
# - All by default (without Inductor)
44
- ("", 3, False, [True] * 4, True),
45
- ("", 4, False, [True] * 4, True),
45
+ (None, 3, False, [True] * 4, True),
46
+ (None, 4, False, [True] * 4, True),
47
# Explicitly enabling/disabling
48
#
49
# Default: all
@@ -54,7 +55,7 @@ class Relu3(ReLUSquaredActivation):
55
# All but SiluAndMul
56
("all,-silu_and_mul", 2, True, [1, 0, 1, 1], True),
57
# All but ReLU3 (even if ReLU2 is on)
57
- ("-relu3,relu2", 3, False, [1, 1, 1, 0], True),
58
+ ("-relu3,+relu2", 3, False, [1, 1, 1, 0], True),
59
# RMSNorm and SiluAndMul
60
("none,-relu3,+rms_norm,+silu_and_mul", 4, False, [1, 1, 0, 0], False),
61
# All but RMSNorm
@@ -67,12 +68,13 @@ class Relu3(ReLUSquaredActivation):
68
# All but RMSNorm
69
("all,-rms_norm", 4, True, [0, 1, 1, 1], True),
70
])
70
-def test_enabled_ops(env: str, torch_level: int, use_inductor: bool,
71
+def test_enabled_ops(env: Optional[str], torch_level: int, use_inductor: bool,
72
ops_enabled: list[int], default_on: bool):
73
+ custom_ops = env.split(',') if env else []
74
vllm_config = VllmConfig(
75
compilation_config=CompilationConfig(use_inductor=bool(use_inductor),
76
level=torch_level,
75
- custom_ops=env.split(",")))
77
+ custom_ops=custom_ops))
78
with set_current_vllm_config(vllm_config):
79
assert CustomOp.default_on() == default_on
80