-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bugfix][IPEX] Add VLLM_CPU_MOE_PREPACK
to allow disabling MoE prepack when CPU does not support it
#14681
Conversation
Signed-off-by: Thien Tran <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
@bigPYJ1151 Do you mind taking a look at this PR? Thank you |
@@ -104,7 +104,7 @@ def process_weights_after_loading(self, layer: torch.nn.Module) -> None: | |||
layer.ipex_fusion = ipex.llm.modules.GatedMLPMOE( | |||
layer.w13_weight, | |||
layer.w2_weight, | |||
use_prepack=True, | |||
use_prepack=ipex._C.onednn_has_bf16_support(), |
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.
Perhaps make this config as a environment variable is better, such as VLLM_CPU_MOE_PREPACK
, by default is False
.
You can refer to VLLM_CPU_OMP_THREADS_BIND
for adding an env in vLLM.
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 have made the change. I set True
by default to maintain current behavior, unless you want to change the default to False instead? (Then we probably need to document this flag somewhere e.g. CPU perf)
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.
No problem.
Please also update the section Related runtime environment variables
in docs/source/getting_started/installation/cpu.md
, thanks :)
Signed-off-by: Thien Tran <[email protected]>
Signed-off-by: Thien Tran <[email protected]>
LGTM, thanks for your fix! |
use_prepack=False
for MoE when it's not supportedVLLM_CPU_MOE_PREPACK
to allow disabling MoE prepack when CPU does not support it
…ack when CPU does not support it (vllm-project#14681) Signed-off-by: Thien Tran <[email protected]> Signed-off-by: Richard Liu <[email protected]>
On my Ryzen 5600
Hence, I use the value of
core.onednn_has_bf16_support()
to decide whether to enable weight prepack.