forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 4
PyTorch oneDNN_aarch64 build manual for GCC(PyTorch v1.7.0)
Kazutoshi, Akao edited this page Apr 5, 2021
·
4 revisions
Currently, PyTorch-oneDNN_aarch64 support for ARMv8-A with SVE. If you run PyTorch-oneDNN_aarch64 on CPUs without SVE, it will be aborted because of undefined instruction exception.
Hardware | Fujitsu FX1000 / 700 |
---|---|
OS | RedHad 8.1 / Centos 8.1 |
Compiler | GCC 8.3.1 20190507 |
- Download PyTorch from the repository.
git clone -b fujitsu_v1.7.0_for_a64fx https://github.com/fujitsu/pytorch.git
- Update submodule.
cd pytorch
git submodule update --init --recursive
- Download and pre-build oneDNN_aarch64.
pushd third_party/ideep
mv mkl-dnn mkl-dnn_bak
git clone https://github.com/fujitsu/oneDNN.git mkl-dnn
pushd mkl-dnn
git checkout -b v2.1.0L01_aarch64 refs/tags/v2.1.0L01_aarch64
git submodule update --init --recursive
mkdir -p src/cpu/aarch64/xbyak_translator_aarch64/translator/third_party/build_xed_aarch64
pushd src/cpu/aarch64/xbyak_translator_aarch64/translator/third_party/build_xed_aarch64
../xed/mfile.py --shared examples install
cd kits
ln -sf xed-install-base-* xed
cd ../../../../
make -j48
popd
popd
popd
- Install the required Python module.
pip3 install pyyaml cython numpy typing-extensions dataclasses hypothesis
- Build PyTorch-oneDNN_aarch64.
export LD_LIBRARY_PATH=`pwd`/third_party/ideep/mkl-dnn/src/cpu/aarch64/xbyak_translator_aarch64/translator/third_party/build_xed_aarch64/kits/xed/lib:${LD_LIBRARY_PATH}
python3 setup.py install
- Please read the Performance Tune page for FX700/FX1000 optimization methods.
$ python3 scripts/fujitsu/test_train.py --batch 32 --itr 5 --type cpu_mkltensor
$ python3 scripts/fujitsu/test_eval.py --batch 32 --itr 5 --type cpu_mkltensor
Copyright RIKEN, Japan 2021
Copyright FUJITSU LIMITED 2021