Skip to content

Commit 70e500c

Browse files
jovsaProExpertProg
andauthored
Fix broken tests (#14713)
Signed-off-by: JovanSardinha <jovan.sardinha@gmail.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
1 parent 4cb1c05 commit 70e500c

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

.buildkite/test-pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ steps:
295295
# these tests need to be separated, cannot combine
296296
- pytest -v -s compile/piecewise/test_simple.py
297297
- pytest -v -s compile/piecewise/test_toy_llama.py
298+
- pytest -v -s compile/test_pass_manager.py
298299

299300
- label: PyTorch Fullgraph Test # 18min
300301
source_file_dependencies:

requirements/test.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ matplotlib # required for qwen-vl test
3030
mistral_common[opencv] >= 1.5.4 # required for pixtral test
3131
datamodel_code_generator # required for minicpm3 test
3232
lm-eval[api]==0.4.4 # required for model evaluation test
33-
transformers==4.48.2
33+
transformers==4.48.2
3434
# quantization
3535
bitsandbytes>=0.45.3
3636
buildkite-test-collector==0.1.9

tests/compile/test_pass_manager.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,38 @@
44

55
import pytest
66
import torch
7-
from torch._inductor.codecache import BypassFxGraphCache
87

9-
from vllm.compilation.config import CompilationConfig
10-
from vllm.compilation.inductor_pass import (CallableInductorPass,
11-
as_inductor_pass)
8+
from vllm.compilation.inductor_pass import CallableInductorPass, InductorPass
129
from vllm.compilation.pass_manager import PostGradPassManager
10+
from vllm.config import CompilationConfig
1311

1412

1513
def simple_callable(graph: torch.fx.Graph):
1614
pass
1715

1816

19-
@as_inductor_pass(files=(__file__, ))
20-
def callable_decorated(graph: torch.fx.Graph):
21-
pass
17+
callable_uuid = CallableInductorPass(simple_callable,
18+
InductorPass.hash_source(__file__))
2219

2320

2421
@pytest.mark.parametrize(
2522
"works, callable",
26-
[(False, simple_callable), (True, callable_decorated),
27-
(True, CallableInductorPass(simple_callable, "simple_callable"))])
23+
[
24+
(False, simple_callable),
25+
(True, callable_uuid),
26+
(True, CallableInductorPass(simple_callable)),
27+
],
28+
)
2829
def test_pass_manager(works: bool, callable):
2930
config = CompilationConfig().pass_config
30-
pass_manager = PostGradPassManager([callable])
31-
pass_manager.configure(config) # Adds default passes
3231

32+
pass_manager = PostGradPassManager()
33+
pass_manager.configure(config)
34+
35+
# Try to add the callable to the pass manager
3336
if works:
37+
pass_manager.add(callable)
3438
pickle.dumps(pass_manager)
3539
else:
36-
with pytest.raises(BypassFxGraphCache):
37-
pickle.dumps(pass_manager)
40+
with pytest.raises(AssertionError):
41+
pass_manager.add(callable)

0 commit comments

Comments
 (0)