Skip to content
Merged
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions vllm/config/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ class CompilationConfig:
since we know all keys are in a range [0, max_capture_size],
we can optimize it to list[int] for better lookup performance."""

use_horizontal_fusion = True
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The use_horizontal_fusion flag is enabled by default. This will automatically enable the combo_kernels feature in PyTorch Inductor for users on versions 2.9.0.dev or newer. Since this relies on a feature in a development version of PyTorch, it may be unstable. It would be safer to set this to False by default to prevent potential issues for users on bleeding-edge PyTorch versions. Users can then explicitly opt-in to enable this experimental feature.

Suggested change
use_horizontal_fusion = True
use_horizontal_fusion = False

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to enable by default since it benefits models in general.

"""Whether use horizontal fusion. This is
useful for fusing qk-norm and qk-rope when query and key have
different shapes."""

# keep track of enabled and disabled custom ops
enabled_custom_ops: Counter[str] = field(default_factory=Counter, init=False)
"""custom ops that are enabled"""
Expand Down Expand Up @@ -498,6 +503,10 @@ def __post_init__(self) -> None:
if isinstance(self.pass_config, dict):
self.pass_config = PassConfig(**self.pass_config)

if self.use_horizontal_fusion and is_torch_equal_or_newer("2.9.0.dev"):
self.inductor_compile_config["combo_kernels"] = True
self.inductor_compile_config["benchmark_combo_kernel"] = True

# migrate the deprecated flags
if not self.use_cudagraph:
logger.warning(
Expand Down