mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-16 00:28:10 +08:00
The training efficiency of the Ascend 910A has been significantly enhanced, 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.
Former-commit-id: 90980b626d3408b3e2ee32a02456c20881318be7
This commit is contained in:
parent
25de4ce56a
commit
3d1b0e1864
@ -1,3 +1,7 @@
|
||||
import os
|
||||
import torch
|
||||
import torch_npu
|
||||
from torch_npu.contrib import transfer_to_npu
|
||||
from llmtuner.train.tuner import run_exp
|
||||
|
||||
|
||||
@ -11,4 +15,6 @@ def _mp_fn(index):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
use_jit_compile = os.getenv('JIT_COMPILE', 'False').lower() in ['true', '1']
|
||||
torch.npu.set_compile_mode(jit_compile=use_jit_compile)
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user