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.
What does this PR do?
Fixes # (issue)
Remove code path of Flash Attention V1 for Qwen2 Family
Because SDPA can support long sequence since 1.16.0, this code path is no longer needed.
WA for accuracy issue of Qwen2 Family
Qwen2 Family has bias add for Q/K/V linear, and it requires to keep FP32 accuracy for Q*K, a WA method has been added to keep the accuracy:
This is necessary for Qwen2 Family, especially for Qwen2-57B-A14B-Instruct. Without such WA:
the output would be:
With such WA:
output would be:
From lm_eval task, such WA can improve the score of Qwen2-7B-Instruct from 0.3 to 0.5.
Add beam search for Qwen2-MoE
Refactor the general code path for Qwen2 Family
Add Dynamic MoE for Qwen2-MoE in inference mode
Before submitting