huawei-ascend-npu #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: huawei-ascend-npu | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '.github/workflows/huawei-ascend-npu.yml' | |
- 'requirements/**' | |
schedule: | |
- cron: "0 0 * * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
issues: write | |
jobs: | |
unit-tests: | |
runs-on: [self-hosted, ascend, npu] | |
container: | |
image: ascendai/cann | |
ports: | |
- 80 | |
options: --device /dev/davinci4 | |
--device /dev/davinci_manager | |
--device /dev/devmm_svm | |
--device /dev/hisi_hdc | |
--shm-size "20g" | |
-v /usr/local/dcmi:/usr/local/dcmi | |
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi | |
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ | |
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info | |
-v /etc/ascend_install.info:/etc/ascend_install.info | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pytorch | |
run: | | |
npu-smi info | |
apt-get update | |
echo "export LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64/common:/usr/local/Ascend/driver/lib64/driver:${LD_LIBRARY_PATH}" >>~/.bashrc | |
echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >>~/.bashrc | |
cat ~/.bashrc | |
pip install torch==2.2.0 torchvision==0.17.0 torch_npu==2.2.0 numpy==1.26.4 cloudpickle tornado -i https://pypi.tuna.tsinghua.edu.cn/simple | |
python -c "import torch; print('torch:', torch.__version__)" | |
python -c "import torch,torch_npu; print('torch_npu:', torch.npu.is_available(),',version:', torch_npu.__version__)" | |
- name: Install deepspeed | |
run: | | |
pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple | |
ds_report | |
- name: Python environment | |
run: | | |
pip list | |
- name: Multi-card parallel training | |
env: | |
GITHUB_TOKEN: ${{ secrets.DEEPSPEED_TOKEN }} | |
run: | | |
echo "y" | apt-get install git | |
git clone https://github.com/microsoft/DeepSpeedExamples.git | |
cd DeepSpeedExamples | |
deepspeed ./training/cifar/cifar10_deepspeed.py | |