Skip to content

Ascend Pytorch Adapter CI/CD #21

Ascend Pytorch Adapter CI/CD

Ascend Pytorch Adapter CI/CD #21

Workflow file for this run

name: Ascend Pytorch Adapter CI/CD
on:
schedule:
- cron: '0 12 * * *'
issue_comment:
types: [created]
jobs:
fetch-and-rebase:
runs-on: Ascend910B-01
steps:
- name: Pull latest codes
run: |
echo "All Success"
# - name: Pull latest codes for torch
# run: |
# pushd /root/codes/pytorch/pytorch &&
# git fetch --all &&
# git rebase upstream/main &&
# git submodule update --init --recursive &&
# git reset --hard HEAD &&
# git clean -dfx &&
# git submodule foreach git reset --hard HEAD &&
# git submodule foreach git clean -dfx &&
# popd
# - name: Pull latest codes for torch_npu
# run: |
# pushd /root/codes/npu/pytorch &&
# git fetch --all &&
# git rebase upstream/main &&
# git submodule update --init --recursive &&
# git reset --hard HEAD &&
# git clean -dfx &&
# git submodule foreach git reset --hard HEAD &&
# git submodule foreach git clean -dfx &&
# popd
compile-and-test:
runs-on: Ascend910B-01
needs: fetch-and-rebase
defaults:
run:
shell: bash
container:
image: ascendai/cann:7.0.RC1.alpha005-openeuler2203sp2
env:
HOME: /root
volumes:
- /usr/local/dcmi:/usr/local/dcmi
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
- /root/codes/:/root/codes
options: --network host --device /dev/davinci7 --device /dev/davinci_manager --device /dev/devmm_svm --device /dev/hisi_hdc
steps:
- name: Set environment
run:
source /root/.bashrc && conda activate torch_npu
- name: Compile torch
working-directory: /root/codes/pytorch/pytorch
run: |
pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
export _GLIBCXX_USE_CXX11_ABI=0
export USE_CUDA=0
export USE_XNNPACK=0
python setup.py develop
- name: Compile and install torch_npu
working-directory: /root/codes/npu/pytorch
run: |
pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
bash ci/build.sh --python=3.8
pip3 install dist/torch_npu*.whl
- name: Do the test
working-directory: /root/codes
run: |
python npu/pytorch/test/run_test.py -v -i test_npu/test_aoe test_npu/test_c10d test_npu/test_device test_npu/test_jit_compile test_npu/test_option test_npu/test_tensor test_npu/test_torch_backends