Skip to content

V1 rocm support #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3450,6 +3450,10 @@ def __post_init__(self):
# FIXME(woosuk): Disable inductor to reduce the compilation time
# and avoid any potential issues with the inductor.
self.compilation_config.custom_ops = ["none"]
if current_platform.is_rocm():
self.compilation_config.custom_ops = [
"+rms_norm", "+silu_and_mul"
]
self.compilation_config.use_cudagraph = True
self.compilation_config.use_inductor = True
self.compilation_config.cudagraph_num_of_warmups = 1
Expand Down
3 changes: 3 additions & 0 deletions vllm/model_executor/layers/tuned_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import torch.nn.functional as F

from vllm import _custom_ops as ops
from vllm import envs
from vllm.envs import VLLM_USE_ROCM_SKINNY_GEMM
from vllm.platforms import current_platform
from vllm.utils import is_mi250, is_navi
Expand Down Expand Up @@ -68,6 +69,8 @@ def create_ds(self):
self.solids = solds

def query_sol(self, m, n, k, bias, dtype):
if envs.VLLM_USE_V1:
return 0, 0
return self.solids.get((m, n, k, bias, str(dtype)), (0, 0))

def apply_skinny(self, m, n, k, inp_view, weights):
Expand Down
1 change: 1 addition & 0 deletions vllm/v1/attention/backends/rocm_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def forward(
value: torch.Tensor,
kv_cache: torch.Tensor,
attn_metadata: FlashAttentionMetadata,
fp8_out_scale: Optional[torch.Tensor],
output: Optional[torch.Tensor] = None,
) -> torch.Tensor:
"""Forward pass with FlashAttention.
Expand Down