Skip to content

Commit f54e9dc

Browse files
authored
addressing numpy2 compatibility issue (#2995)
1 parent 0ed9d2f commit f54e9dc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/tutorials/known_issues.md

+10
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ Troubleshooting
4242
- **Cause**: PyTorch FX limitation.
4343
- **Solution**: You can avoid this error by calling `m = ipex.optimize(m, level="O0")`, which doesn't apply ipex optimization, or disable `conv+bn` folding by calling `m = ipex.optimize(m, level="O1", conv_bn_folding=False)`.
4444

45+
## Package Compatibility
46+
47+
- **Problem**: Error raised during the import of `numpy`.
48+
- **Cause**: `numpy` has some API update in latest 2.0.0 release, but it comes incompatible with some other packages.
49+
- **Solution**: Reinstall a lagacy version of `numpy` with the command:
50+
51+
```
52+
python -m pip install numpy==1.26.4 --force-reinstall
53+
```
54+
4555
## Performance Regression
4656

4757
- Some models may experience performance regression comparing to 2.0.x due to deprecation of the NNC feature in PyTorch\*.

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

+3
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,6 @@ if [ $((${MODE} & 0x01)) -ne 0 ]; then
226226
fi
227227
ln -s ../prompt.json
228228
fi
229+
230+
# Install a legacy numpy version to avoid compatibility issue with deepspeed
231+
python -m pip install numpy==1.26.4 --force-reinstall

0 commit comments

Comments
 (0)