Skip to content

Commit 31b5efc

Browse files
authored
set numpy version for python3.8 (#4564)
* set numpy version <= 1.26.4 instead of == for python3.8 * set version range for numpy * fix format
1 parent 938d4ea commit 31b5efc

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

dependency_version.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ protobuf:
2828
lm_eval:
2929
version: 0.3.0
3030
numpy:
31-
version: 1.26.4
31+
version_min: 1.24.4
32+
version_max: 2.0.0
3233
setuptools:
3334
version: 69.5.1
3435
basekit:

examples/gpu/inference/python/llm/tools/env_setup.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
9494
COMMIT_TRANSFORMERS=$(python tools/yaml_utils.py -f dependency_version.yml -d transformers -k commit)
9595
VER_PROTOBUF=$(python tools/yaml_utils.py -f dependency_version.yml -d protobuf -k version)
9696
VER_LM_EVAL=$(python tools/yaml_utils.py -f dependency_version.yml -d lm_eval -k version)
97-
VER_NUMPY=$(python tools/yaml_utils.py -f dependency_version.yml -d numpy -k version)
97+
VER_NUMPY_MIN=$(python tools/yaml_utils.py -f dependency_version.yml -d numpy -k version_min)
98+
VER_NUMPY_MAX=$(python tools/yaml_utils.py -f dependency_version.yml -d numpy -k version_max)
9899
VER_SETUPTOOLS=$(python tools/yaml_utils.py -f dependency_version.yml -d setuptools -k version)
99100
VER_IPEX_MAJOR=$(grep "VERSION_MAJOR" version.txt | cut -d " " -f 2)
100101
VER_IPEX_MINOR=$(grep "VERSION_MINOR" version.txt | cut -d " " -f 2)
@@ -116,7 +117,8 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
116117
mkdir ${WHEELFOLDER}
117118

118119
# Install deps
119-
python -m pip install cmake ninja numpy==${VER_NUMPY} setuptools==${VER_SETUPTOOLS}
120+
python -m pip install cmake ninja setuptools==${VER_SETUPTOOLS}
121+
python -m pip install "numpy >= ${VER_NUMPY_MIN},< ${VER_NUMPY_MAX}"
120122

121123
echo "#!/bin/bash" > ${AUX_INSTALL_SCRIPT}
122124
if [ $((${MODE} & 0x04)) -ne 0 ]; then
@@ -146,7 +148,8 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
146148
fi
147149

148150
#echo "python -m pip install impi-devel" >> ${AUX_INSTALL_SCRIPT}
149-
echo "python -m pip install numpy==${VER_NUMPY} setuptools==${VER_SETUPTOOLS}" >> ${AUX_INSTALL_SCRIPT}
151+
echo "python -m pip install setuptools==${VER_SETUPTOOLS}" >> ${AUX_INSTALL_SCRIPT}
152+
echo "python -m pip install \"numpy >=${VER_NUMPY_MIN}, <${VER_NUMPY_MAX}\"" >> ${AUX_INSTALL_SCRIPT}
150153
echo "python -m pip install cpuid accelerate datasets sentencepiece diffusers mpi4py protobuf==${VER_PROTOBUF} lm_eval==${VER_LM_EVAL} huggingface_hub py-cpuinfo " >> ${AUX_INSTALL_SCRIPT}
151154
echo "python -m pip install deepspeed==${VER_DS}" >> ${AUX_INSTALL_SCRIPT}
152155
echo "python -m pip install bitsandbytes transformers_stream_generator einops" >> ${AUX_INSTALL_SCRIPT}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Python dependencies required for development
22
expecttest==0.1.6
33
hypothesis
4-
numpy==1.26.4
4+
numpy >=1.24.4, <2.0
55
psutil
66
pytest
77
pyyaml

0 commit comments

Comments
 (0)