Skip to content
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

hf2mcore_qwen1.5_dense_mha_to_moe.py 有个逻辑不太懂的地方 #261

Open
steins048596 opened this issue Jun 13, 2024 · 0 comments
Open

Comments

@steins048596
Copy link

steins048596 commented Jun 13, 2024

第87行,88行,92行,似乎是先把up和gate拼起来,再在后面补上empty,这样的话后面分割的时候不就乱了吗?
整体流程相当于[5504,2048]->[1376,2048],把ffn切成4份
然后把gate和up连在一块,[1376,2048]->[2752,2048]
然后补上初始化的空张量,[2752,2048]->[2816,2048]
这样维度上是对的,但问题在于内部变成[(1376;1376;64),2048],这样后面做计算的时候,up的一部分会算在gate里,而up补了两份空张量。
佬,不知道上面的推导对不对,是有什么我看漏的地方吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant