Unverified Commit 70e500ca authored by Jovan Sardinha's avatar Jovan Sardinha Committed by GitHub
Browse files

Fix broken tests (#14713)


Signed-off-by: default avatarJovanSardinha <jovan.sardinha@gmail.com>
Co-authored-by: default avatarLuka Govedič <ProExpertProg@users.noreply.github.com>
parent 4cb1c05c
...@@ -295,6 +295,7 @@ steps: ...@@ -295,6 +295,7 @@ steps:
# these tests need to be separated, cannot combine # these tests need to be separated, cannot combine
- pytest -v -s compile/piecewise/test_simple.py - pytest -v -s compile/piecewise/test_simple.py
- pytest -v -s compile/piecewise/test_toy_llama.py - pytest -v -s compile/piecewise/test_toy_llama.py
- pytest -v -s compile/test_pass_manager.py
- label: PyTorch Fullgraph Test # 18min - label: PyTorch Fullgraph Test # 18min
source_file_dependencies: source_file_dependencies:
......
...@@ -30,7 +30,7 @@ matplotlib # required for qwen-vl test ...@@ -30,7 +30,7 @@ matplotlib # required for qwen-vl test
mistral_common[opencv] >= 1.5.4 # required for pixtral test mistral_common[opencv] >= 1.5.4 # required for pixtral test
datamodel_code_generator # required for minicpm3 test datamodel_code_generator # required for minicpm3 test
lm-eval[api]==0.4.4 # required for model evaluation test lm-eval[api]==0.4.4 # required for model evaluation test
transformers==4.48.2 transformers==4.48.2
# quantization # quantization
bitsandbytes>=0.45.3 bitsandbytes>=0.45.3
buildkite-test-collector==0.1.9 buildkite-test-collector==0.1.9
......
...@@ -4,34 +4,38 @@ import pickle ...@@ -4,34 +4,38 @@ import pickle
import pytest import pytest
import torch import torch
from torch._inductor.codecache import BypassFxGraphCache
from vllm.compilation.config import CompilationConfig from vllm.compilation.inductor_pass import CallableInductorPass, InductorPass
from vllm.compilation.inductor_pass import (CallableInductorPass,
as_inductor_pass)
from vllm.compilation.pass_manager import PostGradPassManager from vllm.compilation.pass_manager import PostGradPassManager
from vllm.config import CompilationConfig
def simple_callable(graph: torch.fx.Graph): def simple_callable(graph: torch.fx.Graph):
pass pass
@as_inductor_pass(files=(__file__, )) callable_uuid = CallableInductorPass(simple_callable,
def callable_decorated(graph: torch.fx.Graph): InductorPass.hash_source(__file__))
pass
@pytest.mark.parametrize( @pytest.mark.parametrize(
"works, callable", "works, callable",
[(False, simple_callable), (True, callable_decorated), [
(True, CallableInductorPass(simple_callable, "simple_callable"))]) (False, simple_callable),
(True, callable_uuid),
(True, CallableInductorPass(simple_callable)),
],
)
def test_pass_manager(works: bool, callable): def test_pass_manager(works: bool, callable):
config = CompilationConfig().pass_config config = CompilationConfig().pass_config
pass_manager = PostGradPassManager([callable])
pass_manager.configure(config) # Adds default passes
pass_manager = PostGradPassManager()
pass_manager.configure(config)
# Try to add the callable to the pass manager
if works: if works:
pass_manager.add(callable)
pickle.dumps(pass_manager) pickle.dumps(pass_manager)
else: else:
with pytest.raises(BypassFxGraphCache): with pytest.raises(AssertionError):
pickle.dumps(pass_manager) pass_manager.add(callable)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment