-
Notifications
You must be signed in to change notification settings - Fork 2.2k
add qwen2/3 old fused qkv/ffn #3150
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
base: develop
Are you sure you want to change the base?
add qwen2/3 old fused qkv/ffn #3150
Conversation
|
Thanks for your contribution! |
lugimzzz
left a comment
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.
LGTM
JunnYu
left a comment
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.
需要修改
| ) | ||
|
|
||
| return actions | ||
| if config.tie_word_embeddings: |
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.
这里没有tie_word_embeddings的概念了吧?formers默认是 base_actions["lm_head.weight"] = partial(fn, is_column=False) 这个吧
| final_actions = {} | ||
|
|
||
| base_actions = { | ||
| "lm_head.weight": partial(fn, is_column=True), |
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.
partial(fn, is_column=False)
|
|
||
| mappings = make_base_actions() | ||
|
|
||
| if config.tie_word_embeddings: |
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.
同上
|
|
||
| LAYER_ROWWISE = ["self_attn.o_proj.weight"] | ||
| base_actions = { | ||
| "lm_head.weight": partial(fn, is_column=True), |
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.
同上
| { | ||
| f"{cls.base_model_prefix}.layers.{layer_idx}.mlp.experts.{e}.{k}": partial( | ||
| fn, is_column=True | ||
| ) |
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.
fuse_attention_ffn的时候需要输入 is_naive_2fuse=True
| for k in LAYER_COLWISE | ||
| } | ||
| ) | ||
| # colwise |
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.
缺少fuse ffn, 然后注意 is_naive_2fuse 的添加
| "mlp.gate_proj.weight", | ||
| ] | ||
|
|
||
| FUSE_LAYER_COLWISE = [ |
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.
全缺少 is_naive_2fuse
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (55.20%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #3150 +/- ##
==========================================
Coverage ? 36.74%
==========================================
Files ? 416
Lines ? 71324
Branches ? 0
==========================================
Hits ? 26207
Misses ? 45117
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

No description provided.