Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions vllm/compilation/vllm_inductor_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import functools
import operator
import time
import weakref
from dataclasses import dataclass
from typing import ClassVar

import regex as re
Expand All @@ -19,6 +19,13 @@
logger = init_logger(__name__)


@dataclass
class InductorCompilationConfig:
splitting_ops: list[str] | None = None
use_inductor_graph_partition: bool = False
compile_sizes: list[int | str] | None = None


class VllmInductorPass(InductorPass):
"""
An inductor pass with access to vLLM PassConfig.
Expand All @@ -29,7 +36,13 @@ class VllmInductorPass(InductorPass):
"""Keep track of pass index for debug dump ordering."""

def __init__(self, config: VllmConfig):
self.compilation_config = weakref.proxy(config.compilation_config)
# Get only the necessary CompilationConfig for the inductor pass, since
# full `CompilationConfig` contains pointer to model which is unsafe.
self.compilation_config = InductorCompilationConfig(
splitting_ops=config.splitting_ops,
use_inductor_graph_partition=config.use_inductor_graph_partition,
compile_sizes=config.compile_sizes,
)
self.pass_config = config.compilation_config.pass_config
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

later pass_config can be also moved.

Copy link
Collaborator Author

@luccafong luccafong Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can utilize it, but it will introduce duplicated attribute in config level, we can think of how to organize these config better in following PR. @zou3519

self.model_dtype = config.model_config.dtype if config.model_config else None
self.device = config.device_config.device if config.device_config else None
Expand Down