Skip to content
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

make fused_moe_kernel's EM and num_valid_tokens arguments do_not_specialize #11057

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion vllm/model_executor/layers/fused_moe/fused_moe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Fused MoE kernel."""
import functools
import inspect
import json
import os
from typing import Any, Callable, Dict, Optional, Tuple
Expand All @@ -16,8 +17,16 @@

logger = init_logger(__name__)

if ("do_not_specialize_on_alignment"
in inspect.getfullargspec(triton.jit).kwonlyargs):
moe_triton_jit = functools.partial(
triton.jit, do_not_specialize_on_alignment=["EM", "num_valid_tokens"])
else:
moe_triton_jit = functools.partial(
triton.jit, do_not_specialize=["EM", "num_valid_tokens"])

@triton.jit

@moe_triton_jit
def fused_moe_kernel(
# Pointers to matrices
a_ptr,
Expand Down
Loading