Skip to content

Commit

Permalink
for cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Bowen12992 committed Jul 3, 2024
1 parent 6c516a6 commit 4a337bb
Showing 1 changed file with 34 additions and 41 deletions.
75 changes: 34 additions & 41 deletions .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,40 @@ jobs:
- name: unit_test-flag-gems
run: |
CUDA_VISIBLE_DEVICES=0 pytest -s tests/test_unary_pointwise_ops.py &
pid1=$!
CUDA_VISIBLE_DEVICES=0 pytest -s tests/test_pointwise_type_promotion.py &
pid2=$!
CUDA_VISIBLE_DEVICES=1 pytest -s tests/test_binary_pointwise_ops.py &
pid3=$!
CUDA_VISIBLE_DEVICES=2 pytest -s tests/test_blas_ops.py &
pid4=$!
CUDA_VISIBLE_DEVICES=3 pytest -s tests/test_reduction_ops.py &
pid5=$!
CUDA_VISIBLE_DEVICES=4 pytest -s tests/test_special_ops.py &
pid6=$!
CUDA_VISIBLE_DEVICES=5 pytest -s tests/test_libentry.py &
pid7=$!
wait $pid1
result1=$?
wait $pid2
result2=$?
wait $pid3
result3=$?
wait $pid4
result4=$?
wait $pid5
result5=$?
wait $pid6
result6=$?
wait $pid7
result7=$?
echo "test_unary_pointwise_ops.py exit status: $result1"
echo "test_pointwise_type_promotion.py exit status: $result2"
echo "test_binary_pointwise_ops.py exit status: $result3"
echo "test_blas_ops.py exit status: $result4"
echo "test_reduction_ops.py exit status: $result5"
echo "test_special_ops.py exit status: $result6"
echo "test_libentry.py exit status: $result7"
if [ $result1 -eq 0 ] && [ $result2 -eq 0 ] && [ $result3 -eq 0 ] && [ $result4 -eq 0 ] && [ $result5 -eq 0 ] && [ $result6 -eq 0 ] && [ $result7 -eq 0 ]; then
echo "All commands executed successfully."
exit 0
else
echo "One or more commands failed."
exit 1
fi
commands=(
"CUDA_VISIBLE_DEVICES=0 pytest -s tests/test_unary_pointwise_ops.py &"
"CUDA_VISIBLE_DEVICES=0 pytest -s tests/test_pointwise_type_promotion.py &"
"CUDA_VISIBLE_DEVICES=1 pytest -s tests/test_binary_pointwise_ops.py &"
"CUDA_VISIBLE_DEVICES=2 pytest -s tests/test_blas_ops.py &"
"CUDA_VISIBLE_DEVICES=3 pytest -s tests/test_reduction_ops.py &"
"CUDA_VISIBLE_DEVICES=4 pytest -s tests/test_special_ops.py &"
"CUDA_VISIBLE_DEVICES=5 pytest -s tests/test_libentry.py &"
)
declare -a exit_statuses
for cmd in "${commands[@]}"; do
eval "$cmd"
done
for job in $(jobs -p); do
wait $job
exit_statuses+=($?)
echo "Task $pid completed with exit status ${exit_statuses[-1]}"
done
echo "Exit statuses of all tasks: ${exit_statuses[@]}"
overall_status=0
for status in "${exit_statuses[@]}"; do
if [ $status -ne 0 ]; then
overall_status=1
break
fi
done
exit $overall_status
container-model-test:
runs-on: [self-hosted, docker]
Expand Down

0 comments on commit 4a337bb

Please sign in to comment.