-
-
Notifications
You must be signed in to change notification settings - Fork 20.3k
[CPU] Refactor CPU fused MOE #30531
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
Merged
Merged
[CPU] Refactor CPU fused MOE #30531
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,7 +330,7 @@ if ((AVX512_FOUND AND NOT AVX512_DISABLED) OR (ASIMD_FOUND AND NOT APPLE_SILICON | |
| PUBLIC ${oneDNN_BINARY_DIR}/include | ||
| PRIVATE ${oneDNN_SOURCE_DIR}/src | ||
| ) | ||
| target_link_libraries(dnnl_ext dnnl) | ||
| target_link_libraries(dnnl_ext dnnl torch) | ||
| target_compile_options(dnnl_ext PRIVATE ${CXX_COMPILE_FLAGS} -fPIC) | ||
| list(APPEND LIBS dnnl_ext) | ||
| set(USE_ONEDNN ON) | ||
|
|
@@ -358,13 +358,13 @@ set(VLLM_EXT_SRC | |
| "csrc/cpu/pos_encoding.cpp" | ||
| "csrc/moe/dynamic_4bit_int_moe_cpu.cpp" | ||
| "csrc/cpu/cpu_attn.cpp" | ||
| "csrc/cpu/scratchpad_manager.cpp" | ||
| "csrc/cpu/torch_bindings.cpp") | ||
|
|
||
| if (AVX512_FOUND AND NOT AVX512_DISABLED) | ||
| set(VLLM_EXT_SRC | ||
| "csrc/cpu/shm.cpp" | ||
| "csrc/cpu/cpu_wna16.cpp" | ||
| "csrc/cpu/cpu_fused_moe.cpp" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my comments above about |
||
| ${VLLM_EXT_SRC}) | ||
| if (ENABLE_AVX512BF16 AND ENABLE_AVX512VNNI) | ||
| set(VLLM_EXT_SRC | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Given you enabled this through ISA::Vec which is CPU agnostic, would it be a good idea to enable this for all run-cpu-tests, i.e:
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.
Not exactly. This kerenl is only avaliable on AVX512 because of some new vec_op. Other platforms need a bit further change and verification.