-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Add ep #39501
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
Add ep #39501
Conversation
Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
Does not work for mixtral, tricky because of the sequentiality of the weights. I'll add something that allows for this, but also a plan that allows for one the fly merging the modulelist to the format for megablocks |
Will getting deepseek working too be pretty straightforward? |
Yes and no! for both I used nn.Modulelist() (deepseek I had no choice and Mixtral I was junior) and so it's a bit more annoying, but yes because next pr will make sur we have a bit of a better interface! |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
[For maintainers] Suggested jobs to run (before merge) run-slow: llama4 |
For testing target_parameters, we use a tiny Llama4 model. This model was refactored in huggingface/transformers#39501, resulting in one parameter being accessed an additional time: https://github.com/huggingface/transformers/pull/39501/files#diff-e668ec07f78afdb2cb805d939e47453757f0b9437436cb860fcb7cb2431c9cf5R69 Therefore, a unit test that relied on how often this parameter was accessed started failing. This PR updates the count to the correct number. Additionally debug print statements that were accidentally left over are now removed.
For testing target_parameters, we use a tiny Llama4 model. This model was refactored in huggingface/transformers#39501, resulting in one parameter being accessed an additional time: https://github.com/huggingface/transformers/pull/39501/files#diff-e668ec07f78afdb2cb805d939e47453757f0b9437436cb860fcb7cb2431c9cf5R69 Therefore, a unit test that relied on how often this parameter was accessed started failing. This PR updates the count to the correct number. Additionally debug print statements that were accidentally left over are now removed.
Llama4 accuracy is broken by a bug in huggingface#39501 . It forgot to transpose the router_scores before applying it to routed_in, causing Llama4 to generate garbage output. This PR fixes that issue by adding back the transpose() and adding some comments explaining why the transpose() is needed. Signed-off-by: Po-Han Huang <[email protected]>
* Fix broken Llama4 accuracy in MoE part Llama4 accuracy is broken by a bug in #39501 . It forgot to transpose the router_scores before applying it to routed_in, causing Llama4 to generate garbage output. This PR fixes that issue by adding back the transpose() and adding some comments explaining why the transpose() is needed. Signed-off-by: Po-Han Huang <[email protected]> * remove comment --------- Signed-off-by: Po-Han Huang <[email protected]> Co-authored-by: Cyril Vallez <[email protected]>
* Fix broken Llama4 accuracy in MoE part Llama4 accuracy is broken by a bug in #39501 . It forgot to transpose the router_scores before applying it to routed_in, causing Llama4 to generate garbage output. This PR fixes that issue by adding back the transpose() and adding some comments explaining why the transpose() is needed. Signed-off-by: Po-Han Huang <[email protected]> * remove comment --------- Signed-off-by: Po-Han Huang <[email protected]> Co-authored-by: Cyril Vallez <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
* EP + updates Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]> * remove unrelated change * not working yet but let's see where it goes! * update the api a bit * udpate * where I am at for now * fix ep * refactor the API * yups * fix * fixup * clean modeling * just support llama4 for now! * properly avoid * fix * nits * Update src/transformers/models/llama4/modeling_llama4.py * Update src/transformers/integrations/tensor_parallel.py * style * ,,,, * update --------- Co-authored-by: Nouamane Tazi <[email protected]> Co-authored-by: drbh <[email protected]>
What does this PR do?
Add support for expert parallel!