-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[INDUCTOR] [CPU] [GPT-FAST-MOE] large perf regression with coordinate_descent_tuning disabled #124697
Comments
With the following optimizations:
Overall profiling
|
With bmm fallback, weight is converted from int8 to bf16 and Onednn uses bf16 weight. With bmm decomposition, type conversion and bmm are fused in one cpp kernel. Bmm fallback leads to the regression because the case is memory bound with batch size 1. |
The perf benefit was found in #124697 (comment). The PR adds intrinsic specializations between int8/uint8 and bf16/fp16. Pull Request resolved: #124828 Approved by: https://github.com/jgong5, https://github.com/jansel
The perf benefit was found in pytorch#124697 (comment). The PR adds intrinsic specializations between int8/uint8 and bf16/fp16. Pull Request resolved: pytorch#124828 Approved by: https://github.com/jgong5, https://github.com/jansel
…124826) Fixes pytorch#124697. Resolve the issue of large regression of GPT-FAST MOE with `coordinate_descent_tuning` disabled. To get better perf for memory bound case, we decompose bmm in lowering. Pull Request resolved: pytorch#124826 Approved by: https://github.com/jgong5, https://github.com/jansel
The perf benefit was found in pytorch#124697 (comment). The PR adds intrinsic specializations between int8/uint8 and bf16/fp16. Pull Request resolved: pytorch#124828 Approved by: https://github.com/jgong5, https://github.com/jansel
…124826) Fixes pytorch#124697. Resolve the issue of large regression of GPT-FAST MOE with `coordinate_descent_tuning` disabled. To get better perf for memory bound case, we decompose bmm in lowering. Pull Request resolved: pytorch#124826 Approved by: https://github.com/jgong5, https://github.com/jansel
The perf benefit was found in pytorch#124697 (comment). The PR adds intrinsic specializations between int8/uint8 and bf16/fp16. Pull Request resolved: pytorch#124828 Approved by: https://github.com/jgong5, https://github.com/jansel
Fixes #124697. Resolve the issue of large regression of GPT-FAST MOE with `coordinate_descent_tuning` disabled. To get better perf for memory bound case, we decompose bmm in lowering. Pull Request resolved: #124826 Approved by: https://github.com/jgong5, https://github.com/jansel
The fixed PR #124826 could harm the perf of LLAMA2. Hence, we need to further investigate other optimization methods for the issue. |
🐛 Describe the bug
When the flag
coordinate_descent_tuning
disabled, GPT-FAST-MOE encounters a large perf regression: 52s -> 1049s. The impact of disabling it on CPU is to fallback bmm and mm in decomposition.Code snippet
Profiling
coordinate_descent_tuning=True
coordinate_descent_tuning=False
Analysis
According to the current analysis, there are two main reasons:
Versions
PyTorch: 34bce27
cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @jgong5 @leslie-fang-intel @yanbing-j @mingfeima
The text was updated successfully, but these errors were encountered: