Skip to content

Commit

Permalink
add new self-hosted CI runner
Browse files Browse the repository at this point in the history
  • Loading branch information
SolenoidWGT committed Jan 17, 2023
1 parent fdd1bb9 commit 1da53e2
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 6 deletions.
49 changes: 48 additions & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,58 @@ jobs:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
env:
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
with:
python-version: ${{ matrix.python-version }}
- name: do_benchmark
run: |
python -m pip install .
python -m pip install ".[test,k8s]"
./ding/scripts/install-k8s-tools.sh
make benchmark
make benchmark
test_multiprocess:
runs-on: self-hosted
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: do_multiprocesstest
timeout-minutes: 40
run: |
python -m pip install box2d-py
python -m pip install .
python -m pip install ".[test,k8s]"
./ding/scripts/install-k8s-tools.sh
make multiprocesstest
test_cuda:
runs-on: self-hosted
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
env:
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
with:
python-version: ${{ matrix.python-version }}
- name: do_unittest
timeout-minutes: 40
run: |
python -m pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
python -m pip install box2d-py
python -m pip install .
python -m pip install ".[test,k8s]"
./ding/scripts/install-k8s-tools.sh
make cudatest
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,20 @@ benchmark:
--durations=0 \
-sv -m benchmark

multiprocesstest:
pytest ${TEST_DIR} \
--cov-report=xml \
--cov-report term-missing \
--cov=${COV_DIR} \
${DURATIONS_COMMAND} \
${WORKERS_COMMAND} \
-sv -m multiprocesstest

test: unittest # just for compatibility, can be changed later

cpu_test: unittest algotest benchmark

all_test: unittest algotest cudatest benchmark
all_test: unittest algotest cudatest benchmark multiprocesstest

format:
yapf --in-place --recursive -p --verbose --style .style.yapf ${FORMAT_DIR}
Expand Down
3 changes: 2 additions & 1 deletion ding/framework/message_queue/perfs/tests/test_perf_nng.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@


@pytest.mark.benchmark
# @pytest.mark.multiprocesstest
@pytest.mark.multiprocesstest
@pytest.mark.cudatest
def test_nng():
if torch.cuda.is_available() and torch.cuda.device_count() >= 2:
address = socket.gethostbyname(socket.gethostname())
Expand Down
4 changes: 2 additions & 2 deletions ding/framework/message_queue/perfs/tests/test_perf_shm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

@pytest.mark.mqbenchmark
@pytest.mark.cudatest
# @pytest.mark.multiprocesstest
@pytest.mark.multiprocesstest
def test_shm_numpy_shm():
if torch.cuda.is_available():
shm_perf_main("shm")


@pytest.mark.mqbenchmark
@pytest.mark.cudatest
# @pytest.mark.multiprocesstest
@pytest.mark.multiprocesstest
def test_shm_cuda_shared_tensor():
if torch.cuda.is_available() and torch.cuda.device_count() >= 2:
shm_perf_main("cuda_ipc")
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.mark.benchmark
@pytest.mark.cudatest
# @pytest.mark.multiprocesstest
@pytest.mark.multiprocesstest
def test_perf_torchrpc_nccl():
address = socket.gethostbyname(socket.gethostname())
init_method = "tcp://{}:{}".format(address, find_free_port(address))
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ markers =
envpooltest
other
tmp
multiprocesstest
mqbenchmark

norecursedirs = ding/hpc_rl/tests

0 comments on commit 1da53e2

Please sign in to comment.