Browse Source

ci(python_test): run python test with cuda

GitOrigin-RevId: bc51c2e4d5
tags/v0.3.2
Megvii Engine Team 5 years ago
parent
commit
9edce7e294
2 changed files with 13 additions and 8 deletions
  1. +1
    -0
      python_module/src/cpp/function_replace.cpp
  2. +12
    -8
      python_module/test/run.sh

+ 1
- 0
python_module/src/cpp/function_replace.cpp View File

@@ -35,6 +35,7 @@ void throw_fork_cuda_exc() {
// call chain:
// python -> fork() -> pthread_atfork -> CudaCheckOnFork ->
// ForkAfterCudaError::throw_
GILManager a;
mgb_log_warn("try to raise python exception for fork after cuda");
PyErr_SetString(PyExc_SystemError, "fork after cuda has been initialized");
}


+ 12
- 8
python_module/test/run.sh View File

@@ -1,9 +1,13 @@
#!/bin/bash
#!/bin/bash -e

cd $(dirname "${BASH_SOURCE[0]}")/..

pytest -m 'not internet' \
--ignore test/pytorch_comparison \
--ignore test/integration/manual \
--ignore megengine/docs \
megengine test
pushd $(dirname "${BASH_SOURCE[0]}")/.. >/dev/null
pytest -xv -m 'not internet'\
--ignore test/unit/module/test_pytorch.py \
--ignore test/pytorch_comparison \
--ignore test/unit/hub/test_hub.py \
--ignore test/unit/data \
--ignore test/integration/manual \
--ignore megengine/docs/ \
--ignore megengine/module/pytorch \
megengine test
popd >/dev/null

Loading…
Cancel
Save