Skip to content

Commit 56cb992

Browse files
Zephyr596xiangyuT
andauthored
LLM: Modify CPU Installation Command for most examples (#11049)
* init * refine * refine * refine * modify hf-agent example * modify all CPU model example * remove readthedoc modify * replace powershell with cmd * fix repo * fix repo * update * remove comment on windows code block * update * update * update * update --------- Co-authored-by: xiangyuT <[email protected]>
1 parent f1156e6 commit 56cb992

File tree

109 files changed

+1620
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1620
-224
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ See the demo of running [*Text-Generation-WebUI*](https://ipex-llm.readthedocs.i
110110
- LLM finetuning on Intel [GPU](python/llm/example/GPU/LLM-Finetuning), including [LoRA](python/llm/example/GPU/LLM-Finetuning/LoRA), [QLoRA](python/llm/example/GPU/LLM-Finetuning/QLoRA), [DPO](python/llm/example/GPU/LLM-Finetuning/DPO), [QA-LoRA](python/llm/example/GPU/LLM-Finetuning/QA-LoRA) and [ReLoRA](python/llm/example/GPU/LLM-Finetuning/ReLora)
111111
- QLoRA finetuning on Intel [CPU](python/llm/example/CPU/QLoRA-FineTuning)
112112
- Integration with community libraries
113-
- [HuggingFace tansformers](python/llm/example/GPU/HF-Transformers-AutoModels)
113+
- [HuggingFace transformers](python/llm/example/GPU/HF-Transformers-AutoModels)
114114
- [Standard PyTorch model](python/llm/example/GPU/PyTorch-Models)
115115
- [DeepSpeed-AutoTP](python/llm/example/GPU/Deepspeed-AutoTP)
116116
- [HuggingFace PEFT](python/llm/example/GPU/LLM-Finetuning/HF-PEFT)

Diff for: docs/readthedocs/source/doc/LLM/Overview/install_cpu.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ Then for running a LLM model with IPEX-LLM optimizations (taking an `example.py`
9797
# e.g. for a server with 48 cores per socket
9898
export OMP_NUM_THREADS=48
9999
numactl -C 0-47 -m 0 python example.py
100-
```
100+
```

Diff for: docs/readthedocs/source/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Code Examples
162162

163163
* Integration with community libraries
164164

165-
* `HuggingFace tansformers <https://github.com/intel-analytics/ipex-llm/tree/main/python/llm/example/GPU/HF-Transformers-AutoModels>`_
165+
* `HuggingFace transformers <https://github.com/intel-analytics/ipex-llm/tree/main/python/llm/example/GPU/HF-Transformers-AutoModels>`_
166166
* `Standard PyTorch model <https://github.com/intel-analytics/ipex-llm/tree/main/python/llm/example/GPU/PyTorch-Models>`_
167167
* `DeepSpeed-AutoTP <https://github.com/intel-analytics/ipex-llm/tree/main/python/llm/example/GPU/Deepspeed-AutoTP>`_
168168
* `HuggingFace PEFT <https://github.com/intel-analytics/ipex-llm/tree/main/python/llm/example/GPU/LLM-Finetuning/HF-PEFT>`_

Diff for: python/llm/example/CPU/Applications/hf-agent/README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@ To run this example with IPEX-LLM, we have some recommended requirements for you
99

1010
### 1. Install
1111
We suggest using conda to manage environment:
12+
13+
On Linux:
1214
```bash
1315
conda create -n llm python=3.11
1416
conda activate llm
1517

16-
pip install ipex-llm[all] # install ipex-llm with 'all' option
18+
# install ipex-llm with 'all' option
19+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
1720
pip install pillow # additional package required for opening images
1821
```
1922

23+
On Windows:
24+
```cmd
25+
conda create -n llm python=3.11
26+
conda activate llm
27+
28+
pip install --pre --upgrade ipex-llm[all]
29+
pip install pillow
30+
```
31+
2032
### 2. Run
2133
```
2234
python ./run_agent.py --repo-id-or-model-path REPO_ID_OR_MODEL_PATH --image-path IMAGE_PATH
@@ -32,7 +44,7 @@ Arguments info:
3244
3345
#### 2.1 Client
3446
On client Windows machine, it is recommended to run directly with full utilization of all cores:
35-
```powershell
47+
```cmd
3648
python ./run_agent.py --image-path IMAGE_PATH
3749
```
3850

Diff for: python/llm/example/CPU/Applications/streaming-llm/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,20 @@ model = AutoModelForCausalLM.from_pretrained(model_name_or_path, load_in_4bit=Tr
99

1010
## Prepare Environment
1111
We suggest using conda to manage environment:
12+
13+
On Linux
1214
```bash
1315
conda create -n llm python=3.11
1416
conda activate llm
1517

18+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
19+
```
20+
21+
On Windows:
22+
```cmd
23+
conda create -n llm python=3.11
24+
conda activate llm
25+
1626
pip install --pre --upgrade ipex-llm[all]
1727
```
1828

Diff for: python/llm/example/CPU/Deepspeed-AutoTP/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ pip install deepspeed==0.11.1
2020
# 4. exclude intel deepspeed extension, which is only for XPU
2121
pip uninstall intel-extension-for-deepspeed
2222
# 5. install ipex-llm
23-
pip install --pre --upgrade ipex-llm[all]
23+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Advanced-Quantizations/AWQ/README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,31 @@ In the example [generate.py](./generate.py), we show a basic use case for a AWQ
3333

3434
We suggest using conda to manage environment:
3535

36+
On Linux
37+
3638
```bash
3739
conda create -n llm python=3.11
3840
conda activate llm
3941

4042
pip install autoawq==0.1.8 --no-deps
41-
pip install --pre --upgrade ipex-llm[all] # install ipex-llm with 'all' option
43+
# install ipex-llm with 'all' option
44+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
45+
pip install transformers==4.35.0
46+
pip install accelerate==0.25.0
47+
pip install einops
48+
```
49+
On Windows:
50+
```cmd
51+
conda create -n llm python=3.11
52+
conda activate llm
53+
54+
pip install autoawq==0.1.8 --no-deps
55+
pip install --pre --upgrade ipex-llm[all]
4256
pip install transformers==4.35.0
4357
pip install accelerate==0.25.0
4458
pip install einops
4559
```
60+
4661
**Note: For Mixtral model, please use transformers 4.36.0:**
4762
```bash
4863
pip install transformers==4.36.0
@@ -68,7 +83,7 @@ Arguments info:
6883

6984
On client Windows machine, it is recommended to run directly with full utilization of all cores:
7085

71-
```powershell
86+
```cmd
7287
python ./generate.py
7388
```
7489

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Advanced-Quantizations/GGUF/README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,32 @@ In the example [generate.py](./generate.py), we show a basic use case to load a
2424
We suggest using conda to manage the Python environment. For more information about conda installation, please refer to [here](https://docs.conda.io/en/latest/miniconda.html#).
2525

2626
After installing conda, create a Python environment for IPEX-LLM:
27+
28+
On Linux
2729
```bash
2830
conda create -n llm python=3.11 # recommend to use Python 3.11
2931
conda activate llm
3032

31-
pip install --pre --upgrade ipex-llm[all] # install the latest ipex-llm nightly build with 'all' option
33+
# install the latest ipex-llm nightly build with 'all' option
34+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
3235
pip install transformers==4.36.0 # upgrade transformers
3336
```
37+
38+
On Windows:
39+
```cmd
40+
conda create -n llm python=3.11
41+
conda activate llm
42+
43+
pip install --pre --upgrade ipex-llm[all]
44+
pip install transformers==4.36.0
45+
```
46+
3447
### 2. Run
3548
After setting up the Python environment, you could run the example by following steps.
3649

3750
#### 2.1 Client
3851
On client Windows machines, it is recommended to run directly with full utilization of all cores:
39-
```powershell
52+
```cmd
4053
python ./generate.py --model <path_to_gguf_model> --prompt 'What is AI?'
4154
```
4255
More information about arguments can be found in [Arguments Info](#23-arguments-info) section. The expected output can be found in [Sample Output](#24-sample-output) section.

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Advanced-Quantizations/GPTQ/README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,31 @@ To run these examples with IPEX-LLM, we have some recommended requirements for y
88
In the example [generate.py](./generate.py), we show a basic use case for a Llama2 model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
99
### 1. Install
1010
We suggest using conda to manage environment:
11+
12+
On Linux
1113
```bash
1214
conda create -n llm python=3.11
1315
conda activate llm
1416

15-
pip install ipex-llm[all] # install ipex-llm with 'all' option
17+
# install ipex-llm with 'all' option
18+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
1619
pip install transformers==4.34.0
1720
BUILD_CUDA_EXT=0 pip install git+https://github.com/PanQiWei/AutoGPTQ.git@1de9ab6
1821
pip install optimum==0.14.0
1922
```
2023

24+
On Windows:
25+
```cmd
26+
conda create -n llm python=3.11
27+
conda activate llm
28+
29+
pip install --pre --upgrade ipex-llm[all]
30+
pip install transformers==4.34.0
31+
set BUILD_CUDA_EXT=0
32+
pip install git+https://github.com/PanQiWei/AutoGPTQ.git@1de9ab6
33+
pip install optimum==0.14.0
34+
```
35+
2136
### 2. Run
2237
```
2338
python ./generate.py --repo-id-or-model-path REPO_ID_OR_MODEL_PATH --prompt PROMPT --n-predict N_PREDICT
@@ -34,7 +49,7 @@ Arguments info:
3449
3550
#### 2.1 Client
3651
On client Windows machine, it is recommended to run directly with full utilization of all cores:
37-
```powershell
52+
```cmd
3853
python ./generate.py
3954
```
4055

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Model/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ For OS, IPEX-LLM supports Ubuntu 20.04 or later (glibc>=2.17), CentOS 7 or later
99
## Best Known Configuration on Linux
1010
For better performance, it is recommended to set environment variables on Linux with the help of IPEX-LLM:
1111
```bash
12-
pip install ipex-llm
12+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
1313
source ipex-llm-init
1414
```

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Model/aquila/README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,24 @@ In the example [generate.py](./generate.py), we show a basic use case for a Aqui
1515
We suggest using conda to manage the Python environment. For more information about conda installation, please refer to [here](https://docs.conda.io/en/latest/miniconda.html#).
1616

1717
After installing conda, create a Python environment for IPEX-LLM:
18+
19+
On Linux
20+
1821
```bash
1922
conda create -n llm python=3.11 # recommend to use Python 3.11
2023
conda activate llm
2124

22-
pip install --pre --upgrade ipex-llm[all] # install the latest ipex-llm nightly build with 'all' option
25+
# install the latest ipex-llm nightly build with 'all' option
26+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
27+
```
28+
29+
On Windows:
30+
31+
```cmd
32+
conda create -n llm python=3.11
33+
conda activate llm
34+
35+
pip install --pre --upgrade ipex-llm[all]
2336
```
2437

2538
### 2. Run
@@ -31,7 +44,7 @@ After setting up the Python environment, you could run the example by following
3144
3245
#### 2.1 Client
3346
On client Windows machines, it is recommended to run directly with full utilization of all cores:
34-
```powershell
47+
```cmd
3548
python ./generate.py --prompt 'AI是什么?'
3649
```
3750
More information about arguments can be found in [Arguments Info](#23-arguments-info) section. The expected output can be found in [Sample Output](#24-sample-output) section.

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Model/aquila2/README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,24 @@ In the example [generate.py](./generate.py), we show a basic use case for a Aqui
1515
We suggest using conda to manage the Python environment. For more information about conda installation, please refer to [here](https://docs.conda.io/en/latest/miniconda.html#).
1616

1717
After installing conda, create a Python environment for IPEX-LLM:
18+
19+
On Linux:
20+
1821
```bash
1922
conda create -n llm python=3.11 # recommend to use Python 3.11
2023
conda activate llm
2124

22-
pip install --pre --upgrade ipex-llm[all] # install the latest ipex-llm nightly build with 'all' option
25+
# install the latest ipex-llm nightly build with 'all' option
26+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
27+
```
28+
29+
On Windows:
30+
31+
```cmd
32+
conda create -n llm python=3.11
33+
conda activate llm
34+
35+
pip install --pre --upgrade ipex-llm[all]
2336
```
2437

2538
### 2. Run
@@ -31,7 +44,7 @@ After setting up the Python environment, you could run the example by following
3144
3245
#### 2.1 Client
3346
On client Windows machines, it is recommended to run directly with full utilization of all cores:
34-
```powershell
47+
```cmd
3548
python ./generate.py --prompt 'AI是什么?'
3649
```
3750
More information about arguments can be found in [Arguments Info](#23-arguments-info) section. The expected output can be found in [Sample Output](#24-sample-output) section.

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Model/baichuan/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ In the example [generate.py](./generate.py), we show a basic use case for a Baic
99
### 1. Install
1010
We suggest using conda to manage environment:
1111

12+
1213
On Linux:
1314
```bash
1415
conda create -n llm python=3.11
1516
conda activate llm
1617

17-
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu # install ipex-llm with 'all' option
18+
# install ipex-llm with 'all' option
19+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
1820
pip install transformers_stream_generator # additional package required for Baichuan-13B-Chat to conduct generation
1921
```
2022

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Model/baichuan2/README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,28 @@ To run these examples with IPEX-LLM, we have some recommended requirements for y
88
In the example [generate.py](./generate.py), we show a basic use case for a Baichuan model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
99
### 1. Install
1010
We suggest using conda to manage environment:
11+
12+
On Linux:
13+
1114
```bash
1215
conda create -n llm python=3.11
1316
conda activate llm
1417

15-
pip install ipex-llm[all] # install ipex-llm with 'all' option
18+
# install ipex-llm with 'all' option
19+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
20+
1621
pip install transformers_stream_generator # additional package required for Baichuan-13B-Chat to conduct generation
1722
```
1823

24+
On Windows:
25+
```cmd
26+
onda create -n llm python=3.11
27+
conda activate llm
28+
29+
pip install --pre --upgrade ipex-llm[all]
30+
pip install transformers_stream_generator
31+
```
32+
1933
### 2. Run
2034
```
2135
python ./generate.py --repo-id-or-model-path REPO_ID_OR_MODEL_PATH --prompt PROMPT --n-predict N_PREDICT
@@ -32,7 +46,7 @@ Arguments info:
3246
3347
#### 2.1 Client
3448
On client Windows machine, it is recommended to run directly with full utilization of all cores:
35-
```powershell
49+
```cmd
3650
python ./generate.py
3751
```
3852

Diff for: python/llm/example/CPU/HF-Transformers-AutoModels/Model/bluelm/README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,24 @@ To run these examples with IPEX-LLM, we have some recommended requirements for y
88
In the example [generate.py](./generate.py), we show a basic use case for a BlueLM model to predict the next N tokens using `generate()` API, with IPEX-LLM INT4 optimizations.
99
### 1. Install
1010
We suggest using conda to manage environment:
11+
12+
On Linux:
13+
1114
```bash
15+
conda create -n llm python=3.11 # recommend to use Python 3.11
16+
conda activate llm
17+
18+
# install the latest ipex-llm nightly build with 'all' option
19+
pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu
20+
```
21+
22+
On Windows:
23+
24+
```cmd
1225
conda create -n llm python=3.11
1326
conda activate llm
1427
15-
pip install --pre --upgrade ipex-llm[all] # install the latest ipex-llm nightly build with 'all' option
28+
pip install --pre --upgrade ipex-llm[all]
1629
```
1730

1831
### 2. Run
@@ -31,7 +44,7 @@ Arguments info:
3144
3245
#### 2.1 Client
3346
On client Windows machine, it is recommended to run directly with full utilization of all cores:
34-
```powershell
47+
```cmd
3548
python ./generate.py
3649
```
3750

0 commit comments

Comments
 (0)