-
Notifications
You must be signed in to change notification settings - Fork 13.7k
vulkan: fuse mul_mat_id + mul #17095
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
Conversation
|
Please fix the conflict. |
This comes up in qwen3 moe.
4f922ce to
20a4ec2
Compare
|
Rebased. |
| if (mul) { | ||
| std::array<int64_t, 4> ne { 1, out->ne[1], out->ne[2], out->ne[3] }; | ||
| ne[0] = 1; | ||
| ggml_tensor * m = ggml_new_tensor(ctx, out->type, 4, ne.data()); | ||
| out = ggml_mul(ctx, out, m); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like how we keep making the basic, single op test cases more complex by adding flags to change the behavior completely. Can you move the fusion cases to a different class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, done.
0cc4m
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comes up in qwen3 moe. Worth 1-2% on Qwen3 MoE.
I'd eventually like to generalize this, to be able to handle things like MUL_MAT_ID + ADD_ID + MUL (which comes up in gpt-oss).