File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
example/GPU/LLM-Finetuning/QLoRA/alpaca-qlora
src/ipex_llm/transformers Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ pip install bitsandbytes scipy
23
23
source /opt/intel/oneapi/setvars.sh # necessary to run before installing deepspeed
24
24
pip install git+https://github.com/microsoft/DeepSpeed.git@78c518e
25
25
pip install git+https://github.com/intel/intel-extension-for-deepspeed.git@ec33277
26
+ # (optional) install mpirun to run multi-card finetuning
27
+ sudo apt install openmpi-bin
26
28
```
27
29
28
30
### 2. Configures OneAPI environment variables
Original file line number Diff line number Diff line change @@ -794,8 +794,12 @@ def forward(self, x: torch.Tensor):
794
794
self .weight .qtype , input_seq_size )
795
795
result = result .to (x .dtype )
796
796
else :
797
- result = xe_linear .forward_new (x_2d , self .weight .data ,
798
- self .weight .qtype , input_seq_size )
797
+ if self .weight .qtype == NF4 :
798
+ result = xe_linear .forward_new (x_2d , self .weight .data .view (torch .uint8 ),
799
+ self .weight .qtype , input_seq_size )
800
+ else :
801
+ result = xe_linear .forward_new (x_2d , self .weight .data ,
802
+ self .weight .qtype , input_seq_size )
799
803
800
804
if do_empty_cache :
801
805
torch .xpu .empty_cache ()
You can’t perform that action at this time.
0 commit comments