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

finish #1808 cherry-pick, adjust interface #3627

Open
wants to merge 1 commit 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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ at::Tensor fused_moe_impl(
auto tokens = input.size(0);
auto hidden_size = input.size(1);
auto experts = gate_up_weight.size(0);
auto intermediate_size = gate_up_weight.size(1);
// Interface requires that you pass intermediate size. On |gate_only| = False,
// |gate_up_weight| might be 2 * intermediate size, so extract the size from
// |down_weight|
auto intermediate_size = down_weight.size(2);
auto topk = topk_ids.size(1);
auto stride = input.stride(0);

Expand Down Expand Up @@ -81,6 +84,7 @@ at::Tensor fused_moe_impl(
"fp32", // prec_sq (smooth quant)
"fp32", // prec_kw (topk weight)
static_cast<int>(block_m),
1,
static_cast<int>(gate_only),
static_cast<int>(fused_quant)};

Expand Down