Skip to content

Add test coverage for Muon muon_lr/adam_lr overrides #2266

Add test coverage for Muon muon_lr/adam_lr overrides

Add test coverage for Muon muon_lr/adam_lr overrides #2266

name: modal-torch-latest
# This CI is running on modal.com's GPUs.
#
# It's set up here on github actions and then the cloned repo is sent to modal and everything
# happens on their hw - see ci/torch_latest.py for where the actual vm is loaded, updated and the tests are
# run.
#
# Both files are annotated to what's important and how one might change or update things if needed.
#
# Note that since this is a Required job we can't use `on.push.path` file filter - we are using
# collect-tests job to do the filtering for us so that the job can be skipped and satisfy the
# Required status for PRs to pass.
#
on:
workflow_dispatch:
inputs:
torch_preset:
description: Modal PyTorch/CUDA image preset for manual runs
required: false
default: '2.10.0-cuda12.8'
type: choice
options:
- '2.7.1-cuda12.8'
- '2.8.0-cuda12.8'
- '2.9.1-cuda12.8'
- '2.10.0-cuda12.8'
- '2.11.0-cuda12.8'
transformers_source:
description: Hugging Face Transformers source for manual runs
required: false
default: 'git'
type: choice
options:
- 'requirements'
- 'git'
transformers_ref:
description: Hugging Face Transformers git ref to install when source is git
required: false
default: 'main'
type: string
push:
branches:
- master
pull_request_target:
types: [review_requested, ready_for_review, synchronize]
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
collect-tests:
name: modal-torch-latest / collect tests
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
deepspeed: ${{ steps.filter.outputs.deepspeed == 'true' || steps.filter.outputs.modal_workflow == 'true' || steps.filter.outputs.ci == 'true' || steps.filter.outputs.unit_tests == 'true' || steps.filter.outputs.csrc == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Filter changed files
uses: dorny/paths-filter@v3
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
predicate-quantifier: every
filters: |
deepspeed:
- 'deepspeed/**'
- '!deepspeed/inference/v2/**'
modal_workflow:
- '.github/workflows/modal*.yml'
ci:
- 'ci/**'
unit_tests:
- 'tests/unit/**'
- '!tests/unit/inference/v2/**'
csrc:
- 'csrc/**'
deploy:
name: modal-torch-latest / DeepSpeedAI CI
runs-on: ubuntu-latest
needs: collect-tests
if: always() && (github.event_name == 'workflow_dispatch' || needs.collect-tests.result != 'success' || needs.collect-tests.outputs.deepspeed == 'true')
steps:
- name: Fail if path filter failed
if: github.event_name != 'workflow_dispatch' && needs.collect-tests.result != 'success'
run: exit 1
- name: Checkout Repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'pip' # caching pip dependencies
- name: Install build dependencies
run: |
pip install uv # much faster than pip
uv pip install --system modal
- name: Run tests
env:
MODAL_TORCH_PRESET: ${{ github.event.inputs.torch_preset || '2.10.0-cuda12.8' }}
MODAL_TRANSFORMERS_SOURCE: ${{ github.event.inputs.transformers_source || 'git' }}
MODAL_TRANSFORMERS_REF: ${{ github.event.inputs.transformers_ref || 'main' }}
# these are created at https://modal.com/settings/deepspeedai/tokens
# they are then added to the repo's secrets at https://github.com/deepspeedai/deepspeed/settings/secrets/actions
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
# this one comes from https://huggingface.co/settings/profile of the bot user
# and it too is then updated at https://github.com/deepspeedai/deepspeed/settings/secrets/actions
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
modal run -m ci.torch_latest