[parked] Use gpu runner in CI #277
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Test | |
on: | |
pull_request: | |
jobs: | |
unit_tests: | |
runs-on: 4-core-ubuntu-gpu-t4 | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Setup conda env | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: true | |
miniconda-version: "latest" | |
activate-environment: test | |
python-version: ${{ matrix.python-version }} | |
- name: Update pip | |
run: | | |
source .github/workflows/activate_conda_env.sh | |
python -m pip install --upgrade pip | |
- name: Install pytorch | |
run: | | |
source .github/workflows/activate_conda_env.sh | |
python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu129 | |
- name: Install monarch | |
run: | | |
source .github/workflows/activate_conda_env.sh | |
python -m pip install monarch-no-torch==0.1.0.dev20250826 --find-links assets/ci | |
- name: Add GitHub.com to known_hosts | |
run: ssh-keyscan github.com >> ~/.ssh/known_hosts | |
- name: Install torchstore | |
run: | | |
source .github/workflows/activate_conda_env.sh | |
eval "$(ssh-agent -s)" | |
ssh-add - <<< '${{ secrets.FORGE_GITHUB_CI_FOR_TORCHSTORE }}' | |
python -m pip install git+ssh://[email protected]/meta-pytorch/torchstore.git | |
- name: Install dependencies | |
run: | | |
source .github/workflows/activate_conda_env.sh | |
python -m pip install --no-build-isolation -e ".[dev]" | |
- uses: Jimver/cuda-toolkit@master | |
id: cuda-toolkit | |
with: | |
cuda: '12.9.0' | |
log-file-suffix: '${{matrix.python-version}}.txt' | |
- name: Check CUDA version | |
run: | | |
sudo chmod -R 777 $CUDA_PATH | |
$CUDA_PATH/bin/nvcc --version | |
nvidia-smi | |
- name: Run unit tests with coverage | |
# TODO add all tests | |
run: | | |
source .github/workflows/activate_conda_env.sh | |
pytest tests/unit_tests --cov=. --cov-report=xml --durations=20 -vv | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 |