bugfix for qlora finetuning on GPU (#12298)
* bugfix for qlora 100 step error * indent fix * annotation fix
This commit is contained in:
parent
70037ad55f
commit
46d8300f6b
2 changed files with 8 additions and 2 deletions
|
|
@ -23,6 +23,8 @@ pip install bitsandbytes scipy
|
|||
source /opt/intel/oneapi/setvars.sh # necessary to run before installing deepspeed
|
||||
pip install git+https://github.com/microsoft/DeepSpeed.git@78c518e
|
||||
pip install git+https://github.com/intel/intel-extension-for-deepspeed.git@ec33277
|
||||
# (optional) install mpirun to run multi-card finetuning
|
||||
sudo apt install openmpi-bin
|
||||
```
|
||||
|
||||
### 2. Configures OneAPI environment variables
|
||||
|
|
|
|||
|
|
@ -793,6 +793,10 @@ class LowBitLinear(nn.Linear):
|
|||
result = xe_linear.forward_new(x_2d, self.weight.data,
|
||||
self.weight.qtype, input_seq_size)
|
||||
result = result.to(x.dtype)
|
||||
else:
|
||||
if self.weight.qtype == NF4:
|
||||
result = xe_linear.forward_new(x_2d, self.weight.data.view(torch.uint8),
|
||||
self.weight.qtype, input_seq_size)
|
||||
else:
|
||||
result = xe_linear.forward_new(x_2d, self.weight.data,
|
||||
self.weight.qtype, input_seq_size)
|
||||
|
|
|
|||
Loading…
Reference in a new issue