You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run.sh 2.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash -e
  2. TEST_PLAT=$1
  3. export MEGENGINE_LOGGING_LEVEL="ERROR"
  4. if [[ "$TEST_PLAT" == cpu ]]; then
  5. echo "test cpu after Ninja develop"
  6. elif [[ "$TEST_PLAT" == cuda ]]; then
  7. echo "test cuda after Ninja develop"
  8. elif [[ "$TEST_PLAT" == cpu_local ]]; then
  9. echo "test cpu after python3 -m pip install xxx"
  10. elif [[ "$TEST_PLAT" == cuda_local ]]; then
  11. echo "test cuda after python3 -m pip install xxx"
  12. else
  13. echo "ERR args, support list:"
  14. echo "$0 cpu (test cpu after Ninja develop)"
  15. echo "$0 cuda (test cuda after Ninja develop)"
  16. echo "$0 cpu_local (test cpu after python3 -m pip install xxx)"
  17. echo "$0 cuda_local (test cuda after python3 -m pip install xxx)"
  18. exit 1
  19. fi
  20. if [[ "$TEST_PLAT" =~ "local" ]]; then
  21. cd $(dirname "${BASH_SOURCE[0]}")
  22. megengine_dir=`python3 -c 'from pathlib import Path;import megengine;print(Path(megengine.__file__).resolve().parent)'`
  23. test_dirs="${megengine_dir} ."
  24. # FIXME: at aarch64 env, run megengine_dir pytest have exit issue!!
  25. machine=$(uname -m)
  26. case ${machine} in
  27. x86_64) test_dirs="${megengine_dir} ." ;;
  28. aarch64) test_dirs="." ;;
  29. *) echo "nonsupport env!!!";exit -1 ;;
  30. esac
  31. echo "test local env at: ${test_dirs}"
  32. PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'not isolated_distributed'
  33. if [[ "$TEST_PLAT" =~ "cuda" ]]; then
  34. echo "test GPU pytest now"
  35. PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'isolated_distributed' --ignore=./integration/test_dtr.py
  36. fi
  37. else
  38. cd $(dirname "${BASH_SOURCE[0]}")/..
  39. test_dirs="megengine test"
  40. echo "test develop env"
  41. PYTHONPATH="." PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'not isolated_distributed'
  42. if [[ "$TEST_PLAT" =~ "cuda" ]]; then
  43. echo "test GPU pytest now"
  44. PYTHONPATH="." PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'isolated_distributed'
  45. fi
  46. fi