-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
LLM: add fuse optimization for Mistral. #9184
LLM: add fuse optimization for Mistral. #9184
Conversation
@@ -348,4 +348,10 @@ def optimize(model): | |||
convert_forward(model, | |||
module.AquilaRMSNorm, | |||
llama_rms_norm_forward) | |||
elif model.config.model_type == "mistral": | |||
modeling_module_name = model.__class__.__module__ | |||
module = importlib.import_module(modeling_module_name) |
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.
where's attention forward?
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.
fixed.
key_states, | ||
position_ids, | ||
"mistral") |
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.
will have style error?
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.
will check this.
* add fuse optimization for mistral. * fix. * fix * fix style. * fix. * fix error. * fix style. * fix style.
Description
This PR is to add fuse rope and norm optimization for Mistral-7B model.
1. Why the change?
Add fuse rope and norm optimization for XPU, to avoid unnecessary copies and decrease the latency.
2. User API changes
None.
3. How to test?