Skip to content

Commit

Permalink
Merge pull request #11 from Ascend/dev
Browse files Browse the repository at this point in the history
add CI/CD for pytorch ascend adapter
  • Loading branch information
FFFrog authored Oct 27, 2023
2 parents f83db7b + ed91e9c commit 2242929
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/pytorch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Ascend Pytorch Adapter CI/CD

on:
schedule:
- cron: '0 12 * * *'
issue_comment:
types: [created]

jobs:
fetch-and-rebase:
runs-on: self-hosted
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: self-hosted
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/davinci1 --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
File renamed without changes.

0 comments on commit 2242929

Please sign in to comment.