Skip to content

Commit 29400e2

Browse files
authored
feat: change oneccl to internal (#12296)
* feat: change oneccl * fix: restore llama-70b * fix: remove tab * fix: remove extra blank * small fix * add comments * fix: add a blank space
1 parent 6f22133 commit 29400e2

6 files changed

+13
-7
lines changed

python/llm/example/GPU/Deepspeed-AutoTP/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ conda activate llm
2020
# below command will install intel_extension_for_pytorch==2.1.10+xpu as default
2121
pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
2222
pip install transformers==4.37.0
23-
pip install oneccl_bind_pt==2.1.100 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
23+
wget https://sourceforge.net/projects/oneccl-wks/files/2024.0.0.5.1-release/oneccl_wks_installer_2024.0.0.5.1.sh
24+
bash oneccl_wks_installer_2024.0.0.5.1.sh
2425
# configures OneAPI environment variables
2526
source /opt/intel/oneapi/setvars.sh
2627
pip install git+https://github.com/microsoft/DeepSpeed.git@ed8aed5

python/llm/example/GPU/Deepspeed-AutoTP/deepspeed_autotp.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def get_int_from_env(env_keys, default):
104104
deepspeed.comm.comm.cdb = None
105105
from deepspeed.comm.comm import init_distributed
106106
init_distributed()
107-
107+
from ipex_llm.utils import BenchmarkWrapper
108+
model = BenchmarkWrapper(model)
108109
print(model)
109110

110111
# Load tokenizer
@@ -135,7 +136,7 @@ def get_int_from_env(env_keys, default):
135136
actual_output_len = output.shape[1] - input_ids.shape[1]
136137
output_str = tokenizer.decode(output[0], skip_special_tokens=True)
137138
avg_time = (end - st) / actual_output_len * 1000
138-
print(f'Inference time of generating {actual_output_len} tokens: {end-st} s, average token latency is {avg_time} ms/token.')
139+
print(f'Inference time of generating {actual_output_len} tokens: {end-st} s, first token cost {model.first_cost} s, rest tokens average cost {model.rest_cost_mean} s')
139140
print('-'*20, 'Prompt', '-'*20)
140141
print(prompt)
141142
print('-'*20, 'Output', '-'*20)

python/llm/example/GPU/Deepspeed-AutoTP/run_llama2_70b_pvc_1550_1_card.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export CCL_ZE_IPC_EXCHANGE=sockets
2424
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libtcmalloc.so:${LD_PRELOAD}
2525
basekit_root=/opt/intel/oneapi
2626
source $basekit_root/setvars.sh --force
27-
source $basekit_root/ccl/latest/env/vars.sh --force
27+
# source $basekit_root/ccl/latest/env/vars.sh --force deprecate oneccl_bind_pt and use internal oneccl for better performance
28+
source /opt/intel/1ccl-wks/setvars.sh
2829

2930
export OMP_NUM_THREADS=$((56/$NUM_GPUS))
3031
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=2

python/llm/example/GPU/Deepspeed-AutoTP/run_mistral_7b_instruct_flex_2_card.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export CCL_ZE_IPC_EXCHANGE=sockets
2222
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libtcmalloc.so:${LD_PRELOAD}
2323
basekit_root=/opt/intel/oneapi
2424
source $basekit_root/setvars.sh --force
25-
source $basekit_root/ccl/latest/env/vars.sh --force
25+
# source $basekit_root/ccl/latest/env/vars.sh --force deprecate oneccl_bind_pt and use internal oneccl for better performance
26+
source /opt/intel/1ccl-wks/setvars.sh
2627

2728
NUM_GPUS=2 # number of used GPU
2829
export USE_XETLA=OFF

python/llm/example/GPU/Deepspeed-AutoTP/run_qwen_14b_arc_2_card.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export CCL_ZE_IPC_EXCHANGE=sockets
2525
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libtcmalloc.so:${LD_PRELOAD}
2626
basekit_root=/opt/intel/oneapi
2727
source $basekit_root/setvars.sh --force
28-
source $basekit_root/ccl/latest/env/vars.sh --force
28+
# source $basekit_root/ccl/latest/env/vars.sh --force deprecate oneccl_bind_pt and use internal oneccl for better performance
29+
source /opt/intel/1ccl-wks/setvars.sh
2930

3031
NUM_GPUS=2 # number of used GPU
3132
export USE_XETLA=OFF

python/llm/example/GPU/Deepspeed-AutoTP/run_vicuna_33b_arc_2_card.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export CCL_ZE_IPC_EXCHANGE=sockets
2222
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libtcmalloc.so:${LD_PRELOAD}
2323
basekit_root=/opt/intel/oneapi
2424
source $basekit_root/setvars.sh --force
25-
source $basekit_root/ccl/latest/env/vars.sh --force
25+
# source $basekit_root/ccl/latest/env/vars.sh --force deprecate oneccl_bind_pt and use internal oneccl for better performance
26+
source /opt/intel/1ccl-wks/setvars.sh
2627

2728
NUM_GPUS=2 # number of used GPU
2829
export USE_XETLA=OFF

0 commit comments

Comments
 (0)