-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more examples for pipeline parallel inference (#11372)
* add more model exampels for pipelien parallel inference * add mixtral and vicuna models * add yi model and past_kv supprot for chatglm family * add docs * doc update * add license * update
- Loading branch information
Showing
7 changed files
with
279 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
python/llm/example/GPU/Pipeline-Parallel-Inference/run_codellama_arc_2_card.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Copyright 2016 The BigDL Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
source /opt/intel/oneapi/setvars.sh | ||
export MASTER_ADDR=127.0.0.1 | ||
export MASTER_PORT=9090 | ||
export FI_PROVIDER=tcp | ||
export USE_XETLA=OFF | ||
export OMP_NUM_THREADS=6 | ||
export IPEX_LLM_QUANTIZE_KV_CACHE=1 | ||
if [[ $KERNEL_VERSION != *"6.5"* ]]; then | ||
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 | ||
fi | ||
export TORCH_LLM_ALLREDUCE=0 | ||
|
||
NUM_GPUS=2 # number of used GPU | ||
|
||
# To run CodeLlama-7b-Instruct-hf | ||
CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
generate.py --repo-id-or-model-path 'codellama/CodeLlama-7b-Instruct-hf' --gpu-num $NUM_GPUS | ||
|
||
# To run CodeLlama-13b-Instruct-hf | ||
# CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
# generate.py --repo-id-or-model-path 'codellama/CodeLlama-13b-Instruct-hf' --gpu-num $NUM_GPUS | ||
|
||
# To run CodeLlama-34b-Instruct-hf | ||
# CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
# generate.py --repo-id-or-model-path 'codellama/CodeLlama-34b-Instruct-hf' --gpu-num $NUM_GPUS |
37 changes: 37 additions & 0 deletions
37
python/llm/example/GPU/Pipeline-Parallel-Inference/run_mistral_arc_2_card.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright 2016 The BigDL Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
source /opt/intel/oneapi/setvars.sh | ||
export MASTER_ADDR=127.0.0.1 | ||
export MASTER_PORT=9090 | ||
export FI_PROVIDER=tcp | ||
export USE_XETLA=OFF | ||
export OMP_NUM_THREADS=6 | ||
export IPEX_LLM_QUANTIZE_KV_CACHE=1 | ||
if [[ $KERNEL_VERSION != *"6.5"* ]]; then | ||
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 | ||
fi | ||
export TORCH_LLM_ALLREDUCE=0 | ||
|
||
NUM_GPUS=2 # number of used GPU | ||
|
||
# To run Mistral-7B-v0.1 | ||
CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
generate.py --repo-id-or-model-path 'mistralai/Mistral-7B-v0.1' --gpu-num $NUM_GPUS | ||
|
||
# To run Mixtral-8x7B-Instruct-v0.1 | ||
# CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
# generate.py --repo-id-or-model-path 'mistralai/Mixtral-8x7B-Instruct-v0.1' --gpu-num $NUM_GPUS |
33 changes: 33 additions & 0 deletions
33
python/llm/example/GPU/Pipeline-Parallel-Inference/run_solar_arc_2_card.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Copyright 2016 The BigDL Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
source /opt/intel/oneapi/setvars.sh | ||
export MASTER_ADDR=127.0.0.1 | ||
export MASTER_PORT=9090 | ||
export FI_PROVIDER=tcp | ||
export USE_XETLA=OFF | ||
export OMP_NUM_THREADS=6 | ||
export IPEX_LLM_QUANTIZE_KV_CACHE=1 | ||
if [[ $KERNEL_VERSION != *"6.5"* ]]; then | ||
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 | ||
fi | ||
export TORCH_LLM_ALLREDUCE=0 | ||
|
||
NUM_GPUS=2 # number of used GPU | ||
|
||
# To run SOLAR-10.7B-Instruct-v1.0 | ||
CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
generate.py --repo-id-or-model-path 'upstage/SOLAR-10.7B-Instruct-v1.0' --gpu-num $NUM_GPUS |
41 changes: 41 additions & 0 deletions
41
python/llm/example/GPU/Pipeline-Parallel-Inference/run_vicuna_arc_2_card.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Copyright 2016 The BigDL Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
source /opt/intel/oneapi/setvars.sh | ||
export MASTER_ADDR=127.0.0.1 | ||
export MASTER_PORT=9090 | ||
export FI_PROVIDER=tcp | ||
export USE_XETLA=OFF | ||
export OMP_NUM_THREADS=6 | ||
export IPEX_LLM_QUANTIZE_KV_CACHE=1 | ||
if [[ $KERNEL_VERSION != *"6.5"* ]]; then | ||
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 | ||
fi | ||
export TORCH_LLM_ALLREDUCE=0 | ||
|
||
NUM_GPUS=2 # number of used GPU | ||
|
||
# To run vicuna-7b-v1.3 | ||
CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
generate.py --repo-id-or-model-path 'lmsys/vicuna-7b-v1.3' --gpu-num $NUM_GPUS | ||
|
||
# To run vicuna-13b-v1.3 | ||
# CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
# generate.py --repo-id-or-model-path 'lmsys/vicuna-13b-v1.3' --gpu-num $NUM_GPUS | ||
|
||
# To run vicuna-33b-v1.3 | ||
# CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
# generate.py --repo-id-or-model-path 'lmsys/vicuna-33b-v1.3' --gpu-num $NUM_GPUS |
37 changes: 37 additions & 0 deletions
37
python/llm/example/GPU/Pipeline-Parallel-Inference/run_yi_arc_2_card.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright 2016 The BigDL Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
source /opt/intel/oneapi/setvars.sh | ||
export MASTER_ADDR=127.0.0.1 | ||
export MASTER_PORT=9090 | ||
export FI_PROVIDER=tcp | ||
export USE_XETLA=OFF | ||
export OMP_NUM_THREADS=6 | ||
export IPEX_LLM_QUANTIZE_KV_CACHE=1 | ||
if [[ $KERNEL_VERSION != *"6.5"* ]]; then | ||
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 | ||
fi | ||
export TORCH_LLM_ALLREDUCE=0 | ||
|
||
NUM_GPUS=2 # number of used GPU | ||
|
||
# To run Yi-6B-Chat | ||
CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
generate.py --repo-id-or-model-path '01-ai/Yi-6B-Chat' --gpu-num $NUM_GPUS | ||
|
||
# To run Yi-34B-Chat | ||
# CCL_ZE_IPC_EXCHANGE=sockets torchrun --standalone --nnodes=1 --nproc-per-node $NUM_GPUS \ | ||
# generate.py --repo-id-or-model-path '01-ai/Yi-34B-Chat' --gpu-num $NUM_GPUS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters