forked from jittor/jittor
github ci
This commit is contained in:
parent
8127107d87
commit
2dd8e911df
|
@ -0,0 +1,57 @@
|
|||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
on: [ push ]
|
||||
# push:
|
||||
# branches: [ master ]
|
||||
# pull_request:
|
||||
# branches: [ master ]
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
test_clang_8_cuda_10:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: self-hosted
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
export cache_name=github_${GITHUB_REF##*/}
|
||||
export cc_path="clang++-8"
|
||||
export cc_flags=" -g "
|
||||
export log_sync=0
|
||||
export log_v=0
|
||||
export PYTHONIOENCODING=utf8
|
||||
export PYTHONPATH=`pwd`/python
|
||||
export nvcc_path=/usr/local/cuda/bin/nvcc
|
||||
python3.7 -c "import jittor"
|
||||
python3.7 -m jittor.test -v
|
||||
|
||||
test_gcc:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: self-hosted
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
export cache_name=github_${GITHUB_REF##*/}
|
||||
export cc_path="g++"
|
||||
export cc_flags=" -g "
|
||||
export log_sync=0
|
||||
export log_v=0
|
||||
export PYTHONIOENCODING=utf8
|
||||
export PYTHONPATH=`pwd`/python
|
||||
export nvcc_path=
|
||||
python3.7 -c "import jittor"
|
||||
python3.7 -m jittor.test -v
|
|
@ -100,6 +100,7 @@ void NcclTestOp::jit_run() {
|
|||
//finalizing NCCL
|
||||
for(int i = 0; i < nDev; ++i)
|
||||
ncclCommDestroy(comms[i]);
|
||||
checkCudaErrors(cudaSetDevice(0));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -133,8 +133,8 @@ def check_backward(xshape, wshape, stride, padding, dilation, use_cuda, nhwc):
|
|||
jt.sync([cy, closs, cdx, cdw])
|
||||
logs = find_log_with_re(raw_log, "(Jit op key (not )?found: " + op_name + ".*)")
|
||||
assert len(logs)==3 and "oihw" in logs[0][0], (logs)
|
||||
assert np.allclose(y.data, cy.data)
|
||||
assert np.allclose(dw.data, cdw.data), (dw.data, cdw.data)
|
||||
assert np.allclose(y.data, cy.data, 1e-3)
|
||||
assert np.allclose(dw.data, cdw.data, 1e-3), (dw.data, cdw.data)
|
||||
assert np.allclose(dx.data, cdx.data, 1e-3), (dx.data, cdx.data, np.abs(cdx.data).max(), np.abs(dx.data - cdx.data).max())
|
||||
|
||||
class TestConvTuner(unittest.TestCase):
|
||||
|
|
|
@ -123,7 +123,7 @@ class TestCudnnConvOp(unittest.TestCase):
|
|||
assert len(logs)==3 and "oihw" in logs[0][0], logs
|
||||
assert np.allclose(y.data, cy.data)
|
||||
assert np.allclose(dx.data, cdx.data, 1e-2)
|
||||
assert np.allclose(dw.data, cdw.data)
|
||||
assert np.allclose(dw.data, cdw.data, 1e-2)
|
||||
check([10,3,100,100], [5,3,3,3], stride=2, padding=0, dilation=1)
|
||||
check([10,4,40,50], [5,4,5,5], stride=1, padding=1, dilation=1)
|
||||
check([10,4,40,50], [5,4,4,4], stride=3, padding=1, dilation=1)
|
||||
|
|
|
@ -116,7 +116,7 @@ class TestResnet(unittest.TestCase):
|
|||
assert jt.core.number_of_lived_vars() < 3500
|
||||
|
||||
jt.sync_all(True)
|
||||
assert np.mean(loss_list[-50:])<0.2
|
||||
assert np.mean(loss_list[-50:])<0.3
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
@ -31,7 +31,7 @@ class MnistNet(Module):
|
|||
x = self.layer(x)
|
||||
return x
|
||||
|
||||
@unittest.skipIf(skip_model_test, "skip_this_test")
|
||||
@unittest.skipIf(skip_model_test, "skip_this_test, model_test != 1")
|
||||
class TestVGGClass(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
|
|
Loading…
Reference in New Issue