remove qwen2.py llama.py fix llama output
This commit is contained in:
@@ -491,7 +491,7 @@ class KunlunOps:
|
||||
d = y.shape[-1] // 2
|
||||
output_shape = (y.shape[:-1] + (d, ))
|
||||
out1 = torch.empty(output_shape, dtype=y.dtype, device=y.device)
|
||||
torch.ops._C.swiglu(y, out1)
|
||||
torch.ops._C.silu_and_mul(out1, y)
|
||||
|
||||
out = torch.empty(M,moe_top_k,
|
||||
w2.shape[1],
|
||||
@@ -570,7 +570,7 @@ class KunlunOps:
|
||||
cur_token = repeat_x[selected_token]
|
||||
up_gate = torch.empty(selected_token.sum(), up_gate_size//2,
|
||||
dtype=cur_token.dtype, device=cur_token.device)
|
||||
torch.ops._C.swiglu(cur_token@ w13_weight[i].T, up_gate)
|
||||
torch.ops._C.silu_and_mul(up_gate, cur_token@ w13_weight[i].T)
|
||||
out[selected_token] = up_gate @ w2_weight[i].T
|
||||
output = (out.view(batch, top_k, hidden_size) * topk_weights.unsqueeze(2)).sum(dim=1).to(x.dtype)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user