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

Enhancing Ascend 910A Training Efficiency in LlamaFactory with NPU #3584

Merged
merged 4 commits into from May 14, 2024

Conversation

zhou-wjjw
Copy link
Contributor

What does this PR do?

The training efficiency of the Ascend 910A has been significantly enhanced by leveraging the full computational power of the NPU and the capabilities of torch_npu. This enhancement has led to a remarkable tenfold increase in training efficiency.

…anced, leveraging the full computational power of the NPU (Neural Processing Unit) and the capabilities of torch_npu, a PyTorch library optimized for NPUs. This improvement has resulted in a remarkable tenfold increase in efficiency.
@hiyouga hiyouga added the pending This problem is yet to be addressed. label May 6, 2024
@hiyouga
Copy link
Owner

hiyouga commented May 6, 2024

We should first check if the torch_npu package is available, such as

if is_vllm_available():
from vllm import AsyncEngineArgs, AsyncLLMEngine, RequestOutput, SamplingParams
from vllm.lora.request import LoRARequest
from vllm.sequence import MultiModalData

@zhou-wjjw
Copy link
Contributor Author

We should first check if the torch_npu package is available, such as

if is_vllm_available():
from vllm import AsyncEngineArgs, AsyncLLMEngine, RequestOutput, SamplingParams
from vllm.lora.request import LoRARequest
from vllm.sequence import MultiModalData

Alright, so it looks like VLLM doesn't support Ascend. No worries, I'll just tweak the code a bit and see if I can get it working.

@zhou-wjjw
Copy link
Contributor Author

We should first check if the torch_npu package is available, such as

if is_vllm_available():
from vllm import AsyncEngineArgs, AsyncLLMEngine, RequestOutput, SamplingParams
from vllm.lora.request import LoRARequest
from vllm.sequence import MultiModalData

Yeah, I think updating the docs for now and letting the devs figure out how to handle it could be a good way to go. Just make it clear in the documentation that VLLM and Ascend aren't playing nicely together at the moment. That way, the developers can see the issue straight away and decide for themselves how they want to tackle it, based on what works best for their specific project.

Copy link
Contributor

@statelesshz statelesshz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... If you want to use LLaMA-Factory on Ascend910A, this is the modification method I would recommend.

src/train.py Outdated Show resolved Hide resolved
src/train.py Outdated Show resolved Hide resolved
src/train.py Show resolved Hide resolved
src/train.py Outdated Show resolved Hide resolved
src/train.py Outdated Show resolved Hide resolved
@hiyouga
Copy link
Owner

hiyouga commented May 14, 2024

It now works, LGTM

@hiyouga hiyouga merged commit ee4752f into hiyouga:main May 14, 2024
1 check passed
@hiyouga hiyouga added solved This problem has been already solved. and removed pending This problem is yet to be addressed. labels May 14, 2024
@hiyouga hiyouga removed the request for review from statelesshz May 14, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants