mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-22 22:02:51 +08:00
Merge pull request #3584 from zhou-wjjw/main
Enhancing Ascend 910A Training Efficiency in LlamaFactory with NPU Former-commit-id: ee4752f6d209f3f8ac6cf90ef7304e26848e211b
This commit is contained in:
commit
e32a44fe6b
@ -1,3 +1,8 @@
|
||||
import os
|
||||
|
||||
import torch
|
||||
from transformers import is_torch_npu_available
|
||||
|
||||
from llmtuner.train.tuner import run_exp
|
||||
|
||||
|
||||
@ -11,4 +16,7 @@ def _mp_fn(index):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if is_torch_npu_available():
|
||||
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