mirror of
				https://github.com/hiyouga/LLaMA-Factory.git
				synced 2025-11-04 18:02:19 +08:00 
			
		
		
		
	Merge pull request #3584 from zhou-wjjw/main
Enhancing Ascend 910A Training Efficiency in LlamaFactory with NPU Former-commit-id: 310cf017a5ec24af8f5cf3af298760dd4150f9f2
This commit is contained in:
		
						commit
						0a82e15e7c
					
				@ -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