Skip to content

Commit

Permalink
Fix github action CI for GPU (#625)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #625

Differential Revision: D53292685
  • Loading branch information
HuanyuZhang authored and facebook-github-bot committed Feb 15, 2024
1 parent 1ba4113 commit dfa2d30
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 21 deletions.
52 changes: 34 additions & 18 deletions .github/workflows/ci_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,64 @@ on:
branches:
- main

jobs:
unittest_multi_gpu:
runs-on: linux.4xlarge.nvidia.gpu
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [linux.4xlarge.nvidia.gpu]
python-version: [3.8]
cuda-tag: ["cu11"]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Display Python version
run: python -c "import sys; print(sys.version)"

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
./scripts/install_via_pip.sh -c
- name: Run multi-GPU unit tests
run: |
nvidia-smi
nvcc --version
python -m unittest opacus.tests.multigpu_gradcheck.GradientComputationTest.test_gradient_correct
python3 -m unittest opacus.tests.multigpu_gradcheck.GradientComputationTest.test_gradient_correct
integrationtest_py39_torch_release_cuda:
runs-on: ubuntu-latest
container:
# https://hub.docker.com/r/nvidia/cuda
image: nvidia/cuda:12.3.1-base-ubuntu22.04
options: --gpus all
env:
TZ: 'UTC'
# runs-on: linux.4xlarge.nvidia.gpu
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [linux.4xlarge.nvidia.gpu]
python-version: [3.8]
cuda-tag: ["cu11"]
# container:
# # https://hub.docker.com/r/nvidia/cuda
# image: nvidia/cuda:12.3.1-base-ubuntu22.04
# options: --gpus all
# env:
# TZ: 'UTC'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.10.13'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
pip install pytest coverage coveralls
./scripts/install_via_pip.sh -c
Expand Down
7 changes: 4 additions & 3 deletions scripts/install_via_pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ while getopts 'ncdv:' flag; do
# NOTE: Only Debian variants are supported, since this script is only
# used by our tests on CircleCI.

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
# curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# sudo apt-get update && sudo apt-get install yarn
# sudo yum install yarn

# yarn needs terminal info
export TERM=xterm
Expand Down

0 comments on commit dfa2d30

Please sign in to comment.