Add Cambricon MLU accelerator support#2552
Conversation
|
@sgugger Hi, good day. Could you please review this PR, thanks |
|
Sylvain is no longer on this project/at Hugging Face, I’ll review this today. Thanks for your contribution! |
|
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. |
muellerzr
left a comment
There was a problem hiding this comment.
Thanks! Overall this is a very sound PR and looks exciting to support yet another hardware! 🚀
Left some suggestions and a few questions I'd like addressed before moving forward. Thanks!
|
Also for the quality checks, please do |
it's beautiful ! Co-authored-by: Zach Mueller <muellerzr@gmail.com>
Below is the output. |
|
@muellerzr Thanks for your advice.
|
SunMarc
left a comment
There was a problem hiding this comment.
Awesome ! Thanks for the clean integration of MLU with big model inference @huismiling ! Can you confirm that you are able to load a model on multi-mlu when using transformers library ( by passing device_map="auto when loading a model such as llama2 or mistral ) ?
|
cc @SunMarc @muellerzr below is the output. |
|
Fantastic! Thanks for verifying! I’ll merge once the CI finishes :) |
|
torch._dynamo has conflicts with lru_cache. use device.type to do mlu device check. local test is passed ! |
|
Great work! Thanks for verifying! (failing test is unrelated) |
What does this PR do?
If I want to use Cambricon MLUs to train 🤗 Transformers models, the support should be added in Accelerate first and then will come in the Trainer for free.
This PR will support Cambricon MLU accelerator:
accelerate launch nlp_example.pyBelow are the output logs:
Cambricon MLU is a AI processor that support AI frameworks like PyTorch, TensorFlow, etc. So, Its possible run Transformers/Accelerate on MLUs to train foundation model. Website: https://www.cambricon.com