Skip to content

Commit c0d6b28

Browse files
authored
fix lisa finetune example (#12775)
1 parent 2e5f2e5 commit c0d6b28

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

python/llm/example/GPU/LLM-Finetuning/LISA/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ conda create -n llm python=3.11
1313
conda activate llm
1414
# below command will install intel_extension_for_pytorch==2.1.10+xpu as default
1515
pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
16-
pip install bitsandbytes==0.43.0
17-
pip install datasets==2.18.0
18-
pip install --upgrade transformers==4.36.0
19-
pip install scipy fire
16+
pip install transformers==4.45.0 "trl<0.12.0" datasets
17+
pip install bitsandbytes==0.45.1 scipy fire
2018
```
2119

2220
### 2. LISA Finetune
@@ -51,23 +49,23 @@ Optional parameters for `lisa_finetuning.py`:
5149

5250
```log
5351
......
54-
{'loss': 1.8391, 'learning_rate': 1.9967238104745695e-05, 'epoch': 0.03}
55-
{'loss': 1.8242, 'learning_rate': 1.9869167087338908e-05, 'epoch': 0.05}
52+
{'loss': 1.8391, 'learning_rate': 1.9967238104745695e-05, 'epoch': 0.03}
53+
{'loss': 1.8242, 'learning_rate': 1.9869167087338908e-05, 'epoch': 0.05}
5654
5%|██████▉ | 20/388 [xx:xx<x:xx:xx, x.xxs/it]
5755
Activating layers at indices: [10] for the next steps.
58-
{'loss': 1.8128, 'learning_rate': 1.9706429546259592e-05, 'epoch': 0.08}
59-
{'loss': 1.775, 'learning_rate': 1.9480091799562706e-05, 'epoch': 0.1}
56+
{'loss': 1.8128, 'learning_rate': 1.9706429546259592e-05, 'epoch': 0.08}
57+
{'loss': 1.775, 'learning_rate': 1.9480091799562706e-05, 'epoch': 0.1}
6058
10%|██████████████ | 40/388 [xx:xx<xx:xx, x.xxs/it]
6159
Activating layers at indices: [30] for the next steps.
62-
{'loss': 1.7669, 'learning_rate': 1.9191636897958123e-05, 'epoch': 0.13}
63-
{'loss': 1.7749, 'learning_rate': 1.8842954907300236e-05, 'epoch': 0.15}
60+
{'loss': 1.7669, 'learning_rate': 1.9191636897958123e-05, 'epoch': 0.13}
61+
{'loss': 1.7749, 'learning_rate': 1.8842954907300236e-05, 'epoch': 0.15}
6462
15%|█████████████████████ | 60/388 [xx:xx<xx:xx, x.xxs/it]
6563
Activating layers at indices: [26] for the next steps.
66-
{'loss': 1.7735, 'learning_rate': 1.8436330524160048e-05, 'epoch': 0.18}
67-
{'loss': 1.7199, 'learning_rate': 1.797442810562721e-05, 'epoch': 0.21}
64+
{'loss': 1.7735, 'learning_rate': 1.8436330524160048e-05, 'epoch': 0.18}
65+
{'loss': 1.7199, 'learning_rate': 1.797442810562721e-05, 'epoch': 0.21}
6866
21%|████████████████████████████ | 80/388 [xx:xx<xx:xx, x.xxs/it]
6967
Activating layers at indices: [17] for the next steps.
70-
{'loss': 1.7328, 'learning_rate': 1.7460274211432463e-05, 'epoch': 0.23}
68+
{'loss': 1.7328, 'learning_rate': 1.7460274211432463e-05, 'epoch': 0.23}
7169
25%|█████████████████████████████████▋ | 96/388 [xx:xx<xx:xx, x.xxs/it]
7270
......
7371

python/llm/example/GPU/LLM-Finetuning/LISA/lisa_finetuning.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ def train(
9090
model = AutoModelForCausalLM.from_pretrained(
9191
base_model,
9292
load_in_low_bit="bf16",
93-
optimize_model=True,
93+
optimize_model=False,
9494
torch_dtype=torch.bfloat16,
95-
trust_remote_code=True
95+
trust_remote_code=True,
96+
modules_to_not_convert=["lm_head"], # avoid optimize lm_head
9697
)
9798

9899
model = model.to("xpu")

0 commit comments

Comments
 (0)