Skip to content

Commit 1da53e2

Browse files
committed
add new self-hosted CI runner
1 parent fdd1bb9 commit 1da53e2

File tree

6 files changed

+65
-6
lines changed

6 files changed

+65
-6
lines changed

.github/workflows/unit_test.yml

+48-1
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,58 @@ jobs:
4747
- uses: actions/checkout@v2
4848
- name: Set up Python ${{ matrix.python-version }}
4949
uses: actions/setup-python@v2
50+
env:
51+
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
5052
with:
5153
python-version: ${{ matrix.python-version }}
5254
- name: do_benchmark
5355
run: |
5456
python -m pip install .
5557
python -m pip install ".[test,k8s]"
5658
./ding/scripts/install-k8s-tools.sh
57-
make benchmark
59+
make benchmark
60+
61+
test_multiprocess:
62+
runs-on: self-hosted
63+
if: "!contains(github.event.head_commit.message, 'ci skip')"
64+
strategy:
65+
matrix:
66+
python-version: ["3.7", "3.8", "3.9"]
67+
steps:
68+
- uses: actions/checkout@v3
69+
- name: Set up Python ${{ matrix.python-version }}
70+
uses: actions/setup-python@v3
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
- name: do_multiprocesstest
74+
timeout-minutes: 40
75+
run: |
76+
python -m pip install box2d-py
77+
python -m pip install .
78+
python -m pip install ".[test,k8s]"
79+
./ding/scripts/install-k8s-tools.sh
80+
make multiprocesstest
81+
82+
test_cuda:
83+
runs-on: self-hosted
84+
if: "!contains(github.event.head_commit.message, 'ci skip')"
85+
strategy:
86+
matrix:
87+
python-version: ["3.7", "3.8", "3.9"]
88+
steps:
89+
- uses: actions/checkout@v3
90+
- name: Set up Python ${{ matrix.python-version }}
91+
uses: actions/setup-python@v3
92+
env:
93+
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
94+
with:
95+
python-version: ${{ matrix.python-version }}
96+
- name: do_unittest
97+
timeout-minutes: 40
98+
run: |
99+
python -m pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
100+
python -m pip install box2d-py
101+
python -m pip install .
102+
python -m pip install ".[test,k8s]"
103+
./ding/scripts/install-k8s-tools.sh
104+
make cudatest

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,20 @@ benchmark:
5757
--durations=0 \
5858
-sv -m benchmark
5959

60+
multiprocesstest:
61+
pytest ${TEST_DIR} \
62+
--cov-report=xml \
63+
--cov-report term-missing \
64+
--cov=${COV_DIR} \
65+
${DURATIONS_COMMAND} \
66+
${WORKERS_COMMAND} \
67+
-sv -m multiprocesstest
68+
6069
test: unittest # just for compatibility, can be changed later
6170

6271
cpu_test: unittest algotest benchmark
6372

64-
all_test: unittest algotest cudatest benchmark
73+
all_test: unittest algotest cudatest benchmark multiprocesstest
6574

6675
format:
6776
yapf --in-place --recursive -p --verbose --style .style.yapf ${FORMAT_DIR}

ding/framework/message_queue/perfs/tests/test_perf_nng.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77

88
@pytest.mark.benchmark
9-
# @pytest.mark.multiprocesstest
9+
@pytest.mark.multiprocesstest
10+
@pytest.mark.cudatest
1011
def test_nng():
1112
if torch.cuda.is_available() and torch.cuda.device_count() >= 2:
1213
address = socket.gethostbyname(socket.gethostname())

ding/framework/message_queue/perfs/tests/test_perf_shm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
@pytest.mark.mqbenchmark
88
@pytest.mark.cudatest
9-
# @pytest.mark.multiprocesstest
9+
@pytest.mark.multiprocesstest
1010
def test_shm_numpy_shm():
1111
if torch.cuda.is_available():
1212
shm_perf_main("shm")
1313

1414

1515
@pytest.mark.mqbenchmark
1616
@pytest.mark.cudatest
17-
# @pytest.mark.multiprocesstest
17+
@pytest.mark.multiprocesstest
1818
def test_shm_cuda_shared_tensor():
1919
if torch.cuda.is_available() and torch.cuda.device_count() >= 2:
2020
shm_perf_main("cuda_ipc")

ding/framework/message_queue/perfs/tests/test_perf_torchrpc_nccl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@pytest.mark.benchmark
1212
@pytest.mark.cudatest
13-
# @pytest.mark.multiprocesstest
13+
@pytest.mark.multiprocesstest
1414
def test_perf_torchrpc_nccl():
1515
address = socket.gethostbyname(socket.gethostname())
1616
init_method = "tcp://{}:{}".format(address, find_free_port(address))

pytest.ini

+2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ markers =
1010
envpooltest
1111
other
1212
tmp
13+
multiprocesstest
14+
mqbenchmark
1315

1416
norecursedirs = ding/hpc_rl/tests

0 commit comments

Comments
 (0)