Skip to content

Commit

Permalink
Split ci tasks into multiple subtasks
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoguochun1995 committed Sep 23, 2024
1 parent 90913c8 commit 8bdd78c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 14 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/runs_on_ascend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,17 @@ jobs:
source /mnt/cache/share/platform/cienv/ditorch_env
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB}
echo "start to test"
bash ci/test.sh
bash ci/run_op_tools_test_cases.sh
Test_with_pytorch_test_case:
name: run tests using pytorch test case on ascend
runs-on: tps-ascend-ci-910b
needs: [Build]
steps:
- name: test
run: |
set -ex
source /mnt/cache/share/platform/cienv/ditorch_env
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB}
echo "start to test"
bash ci/run_pytorch_test_cases.sh 2>&1
15 changes: 14 additions & 1 deletion .github/workflows/runs_on_camb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,17 @@ jobs:
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB}
echo "start to test"
source /mnt/cache/share/platform/env/ditorch_env
srun -p camb_mlu370_m8 -n 1 --gres=mlu:1 bash ci/test.sh
srun -p camb_mlu370_m8 -n 1 --gres=mlu:1 bash ci/run_op_tools_test_cases.sh
Test_use_pytorch_test_case:
name: run tests using pytorch test case on camb
runs-on: tps-camb-ci
needs: [Build]
steps:
- name: test
run: |
set -ex
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB}
echo "start to test"
source /mnt/cache/share/platform/env/ditorch_env
srun -p camb_mlu370_m8 -n 1 --gres=mlu:1 bash ci/run_pytorch_test_cases.sh
2 changes: 1 addition & 1 deletion .github/workflows/runs_on_nv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
set -ex
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB}
echo "start to test"
srun --job-name=${GITHUB_JOB} bash -c "source /mnt/cache/share/platform/env/ditorch_env && cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${GITHUB_JOB} && bash ci/test.sh"
srun --job-name=${GITHUB_JOB} bash -c "source /mnt/cache/share/platform/env/ditorch_env && cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${GITHUB_JOB} && bash ci/run_op_tools_test_cases.sh"
11 changes: 11 additions & 0 deletions ci/run_op_tools_test_cases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
date
find op_tools/ -name test*.py | xargs -I {} bash -c ' echo "start run {}";date;time python {} && echo "Test {} PASSED\n\n\n" || echo "Test {} FAILED\n\n\n"' 2>&1 | tee test_op_tools_cases.log

# Check if any tests failed
if grep -Eq "FAILED" test_op_tools_cases.log; then
echo "tests failed"
exit 1
else
echo "all tests passed"
exit 0
fi
1 change: 1 addition & 0 deletions ci/run_pytorch_test_cases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python ditorch/test/test_torch_testcase.py 2>&1 | tee test_pytorch_case.log
11 changes: 0 additions & 11 deletions ci/test.sh

This file was deleted.

0 comments on commit 8bdd78c

Please sign in to comment.