Skip to content

Commit 22ff1ca

Browse files
PaliCfacebook-github-bot
authored andcommitted
Add benchmarks to CI and make nightlies more comprehensive (#257)
Summary: Pull Request resolved: #257 Adds a benchmarks sanity check to the our CI to make sure they do not break. It also updates our nightly tests to correspond with our pull request tests such that we don't have to worry about creating broken tarballs. Test Plan: Imported from OSS Reviewed By: d4l3k, anirbanr-fb-r2p Differential Revision: D41010380 Pulled By: PaliC fbshipit-source-id: 98e3b938b252923bea1dbf9010e071cbf21d2838
1 parent 65495ee commit 22ff1ca

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

.github/workflows/runtime_nightly.yaml

+26-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
python3-minor-version: [7,8,9,10]
13-
platform: [ubuntu-18.04]
13+
platform: [linux.4xlarge.nvidia.gpu]
1414
fail-fast: false
1515
runs-on: ${{ matrix.platform }}
1616
steps:
@@ -24,18 +24,40 @@ jobs:
2424
with:
2525
github-secret: ${{ secrets.GITHUB_TOKEN }}
2626

27+
- name: Clean up previous CUDA driver installations
28+
shell: bash
29+
run: |
30+
set -x
31+
yum list installed | grep nvidia || true
32+
yum list installed | grep cuda || true
33+
sudo yum remove -y cuda || true
34+
sudo yum remove -y cuda-drivers || true
35+
sudo yum remove -y "*nvidia*" || true
36+
- name: Install nvidia driver, nvidia-docker runtime, set GPU_FLAG
37+
run: |
38+
bash .github/scripts/install_nvidia_utils_linux.sh || true
39+
echo "GPU_FLAG=--gpus all" >> "${GITHUB_ENV}"
40+
2741
- name: Build
2842
env:
2943
DOCKER_BUILDKIT: 1
30-
run: docker build -t multipy --progress=plain --build-arg PYTHON_3_MINOR_VERSION=${{ matrix.python3-minor-version }} .
44+
run: nvidia-docker build -t multipy --progress=plain --build-arg PYTHON_3_MINOR_VERSION=${{ matrix.python3-minor-version }} --build-arg BUILD_CUDA_TESTS=1 .
3145

3246
- name: Test
3347
run: |
3448
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy"
49+
nvidia-docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy_gpu"
50+
51+
52+
- name: Examples
53+
run: |
54+
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && examples/build/hello_world_example"
55+
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && python3 examples/quickstart/gen_package.py && ./examples/build/quickstart my_package.pt"
56+
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./examples/build/movable_example"
3557
36-
- name: Compat Tests
58+
- name: Benchmark
3759
run: |
38-
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -gt 7 ]]; then pip install -r compat-requirements.txt && multipy/runtime/build/interactive_embedded_interpreter --pyscript multipy/runtime/test_compat.py; fi"
60+
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./multipy/runtime/build/deploy_benchmark 2 none jit multipy/runtime/example/generated/resnet"
3961
4062
- name: Set Python Version
4163
run: |

.github/workflows/runtime_tests.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && python3 examples/quickstart/gen_package.py && ./examples/build/quickstart my_package.pt"
4545
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./examples/build/movable_example"
4646
47+
- name: Benchmark
48+
run: |
49+
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./multipy/runtime/build/deploy_benchmark 2 none jit multipy/runtime/example/generated/resnet"
50+
4751
- name: Compat Tests
4852
run: |
4953
docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -gt 7 ]]; then pip install -r compat-requirements.txt && multipy/runtime/build/interactive_embedded_interpreter --pyscript multipy/runtime/test_compat.py; fi"

0 commit comments

Comments
 (0)