Skip to content

update uv.lock

update uv.lock #8

Workflow file for this run

name: Main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*.*.*"
env:
# Change this to invalidate existing cache.
CACHE_PREFIX: v1
PYTHONPATH: ./src/
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BEAKER_TOKEN: ${{ secrets.BEAKER_TOKEN }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
jobs:
checks:
name: ${{ matrix.task.name }}
runs-on: [ubuntu-latest]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python: ["3.11"]
task:
- name: Lint
run: make lint-check
- name: Test
run: |
pytest -v --color=yes --durations=3 \
--ignore-glob='src/test/distributed/checkpoint*' \
--ignore-glob='src/test/train/checkpoint*' \
--ignore-glob='src/test/nn/*' \
src/test/
- name: Test checkpoint
run: |
pytest -v --color=yes --durations=3 \
src/test/distributed/checkpoint* \
src/test/train/checkpoint*
- name: Test nn
run: |
pytest -v --color=yes --durations=3 \
src/test/nn/
- name: Type check
run: make type-check
- name: Build
run: make build
- name: Style
run: make style-check
- name: Docs
run: |
cd docs && make html SPHINXOPTS="-W --keep-going"
include:
- python: "3.10"
task:
name: Lint (min Python)
run: make lint-check
steps:
- uses: actions/checkout@v4
- name: Setup Python environment
uses: ./.github/actions/setup-venv
with:
python-version: ${{ matrix.python }}
cache-prefix: ${{ env.CACHE_PREFIX }}
- name: Setup Google credentials
run: |
mkdir -p $HOME/.google
printenv GOOGLE_CREDENTIALS > $HOME/.google/credentials.json
echo "GOOGLE_APPLICATION_CREDENTIALS=$HOME/.google/credentials.json" >> $GITHUB_ENV
- name: Restore mypy cache
if: matrix.task.name == 'Type check'
uses: actions/cache@v4
with:
path: .mypy_cache
key: mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-${{ github.ref }}
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
- name: ${{ matrix.task.name }}
run: |
. .venv/bin/activate
${{ matrix.task.run }}
- name: Upload package distribution files
if: matrix.task.name == 'Build'
uses: actions/upload-artifact@v4
with:
name: package
path: dist
- name: Clean up
if: always()
run: |
. .venv/bin/activate
pip uninstall -y ai2-olmo-core
gpu_checks:
name: ${{ matrix.task.name }}
runs-on: ubuntu-latest
timeout-minutes: 15
env:
GANTRY_GITHUB_TESTING: "true" # force better logging for CI
strategy:
fail-fast: false
matrix:
task:
- name: Test (GPU)
image: tylerr/olmo-core-tch270cu128-2025-09-24
gpus: 2
run: |
pytest -v --color=yes --durations=3 -m gpu \
--ignore-glob='src/test/distributed/checkpoint*' \
--ignore-glob='src/test/nn/transformer*' \
--ignore-glob='src/test/nn/moe*' \
src/test/
- name: Test checkpoint (GPU)
image: tylerr/olmo-core-tch270cu128-2025-09-24
gpus: 2
run: |
pytest -v --color=yes --durations=3 -m gpu \
src/test/distributed/checkpoint*
- name: Test transformer (GPU)
image: tylerr/olmo-core-tch270cu128-2025-09-24
gpus: 2
run: |
pytest -v --color=yes --durations=3 -m gpu \
src/test/nn/transformer*
- name: Test MoE (GPU)
image: tylerr/olmo-core-tch270cu128-2025-09-24
gpus: 2
run: |
pytest -v --color=yes --durations=3 -m gpu \
src/test/nn/moe*
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }} # check out PR head commit instead of merge commit
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- name: Install Gantry
run:
# uv tool install git+https://github.com/allenai/beaker-gantry
uv tool install 'beaker-gantry>=3.1,<4.0'
- name: Determine Beaker workspace
if: env.BEAKER_TOKEN != ''
run: |
echo "BEAKER_WORKSPACE=$(make get-beaker-workspace)" >> $GITHUB_ENV
- name: Determine current commit SHA (pull request)
if: github.event_name == 'pull_request'
run: |
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
- name: Determine current commit SHA (push)
if: github.event_name != 'pull_request'
run: |
echo "COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
- name: GPU Tests
if: env.BEAKER_TOKEN != ''
run: |
gantry run \
--show-logs \
--yes \
--workspace ${{ env.BEAKER_WORKSPACE }} \
--description 'OLMo-core ${{ matrix.task.name }}' \
--ref ${{ env.COMMIT_SHA }} \
--branch ${{ env.BRANCH_NAME }} \
--beaker-image ${{ matrix.task.image }} \
--budget ai2/oe-base \
--priority normal \
--preemptible \
--gpus ${{ matrix.task.gpus }} \
--task-timeout 8m \
--host-networking \
--gpu-type h100 \
--gpu-type a100 \
--system-python \
--dataset-secret 'GOOGLE_CREDENTIALS:/.google/credentials.json' \
--env 'GOOGLE_APPLICATION_CREDENTIALS=/.google/credentials.json' \
--env 'TOKENIZERS_PARALLELISM=false' \
--env 'CUBLAS_WORKSPACE_CONFIG=:16:8' \
--env-secret 'AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID' \
--env-secret 'AWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY' \
-- ${{ matrix.task.run }}
release:
name: Release
runs-on: ubuntu-latest
needs: [checks]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python environment
uses: ./.github/actions/setup-venv
with:
python-version: "3.11"
cache-prefix: ${{ env.CACHE_PREFIX }}
- name: Prepare environment
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Download package distribution files
uses: actions/download-artifact@v4
with:
name: package
path: dist
- name: Generate release notes
run: |
. .venv/bin/activate
python src/scripts/release/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
- name: Publish package to PyPI
run: |
. .venv/bin/activate
twine upload -u __token__ -p '${{ secrets.PYPI_TOKEN }}' dist/*
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}-RELEASE_NOTES.md
prerelease: ${{ contains(env.TAG, 'rc') }}
files: |
dist/*
- name: Add PR comments on release
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
./src/scripts/release/add_pr_comments_on_release.sh
- name: Send Slack notifications about release
continue-on-error: true
run: |
. .venv/bin/activate
python ./src/scripts/release/slack_notification.py '${{ secrets.SLACK_WEBHOOK_URL}}'