Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v5
Expand All @@ -30,7 +32,7 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install "setuptools>=78.1.1,<82" wheel build
pip install "setuptools>=78.1.1,<82" "setuptools-scm>=8" wheel build
pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Build sdist
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -69,7 +71,7 @@ jobs:
| pip install -r /dev/stdin 2>&1 || true

- name: Install test tools
run: pip install pytest pytest-xdist pytest-timeout
run: pip install pytest pytest-xdist pytest-timeout "setuptools-scm>=8"

- name: Install package (no CUDA extensions)
run: pip install --no-build-isolation --no-deps -e .
Expand All @@ -80,6 +82,11 @@ jobs:
-m "not gpu and not multi_gpu and not slow and not perf and not network" \
-x --timeout=120 -v

- name: Run DFlash unified validation E2E
run: |
pytest tests/python/integration/test_dflash_unified_validation_e2e.py \
-v

- name: Install contextpilot
run: pip install contextpilot

Expand All @@ -92,6 +99,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v5
Expand All @@ -100,7 +109,7 @@ jobs:

- name: Install build tools
run: |
pip install "setuptools>=78.1.1,<82" wheel build
pip install "setuptools>=78.1.1,<82" "setuptools-scm>=8" wheel build
pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Build sdist
Expand Down
49 changes: 13 additions & 36 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,16 @@ on:
- 'tests/**'
- 'docs/**'

env:
# Bump this to the NEXT planned release when cutting a stable release.
# Nightlies must sort higher than the current stable so that
# `pip install --pre moe-infinity` picks them up.
NIGHTLY_BASE_VERSION: "0.0.2"

permissions:
contents: write

jobs:
setup-version:
runs-on: ubuntu-22.04
steps:
- name: Generate version number
run: |
VERSION_HASH=$(date +"%Y%m%d%H%M%S")
echo "Generated version hash: $VERSION_HASH"
echo $VERSION_HASH > version.txt

- name: Upload version number as artifact
uses: actions/upload-artifact@v4
with:
name: version
path: version.txt

wheel:
name: Build Wheel
runs-on: ${{ matrix.os }}
needs: setup-version
permissions: write-all
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -53,12 +33,8 @@ jobs:
steps:
- name: Checkout Source Code
uses: actions/checkout@v3

- name: Download version value artifact
uses: actions/download-artifact@v4
with:
name: version
path: artifact
fetch-depth: 0

- name: Free disk space
run: |
Expand All @@ -83,13 +59,16 @@ jobs:
- name: Install Python build dependencies (torch matched to CUDA)
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "setuptools>=78.1.1,<82" wheel ninja py-cpuinfo build
python3 -m pip install "setuptools>=78.1.1,<82" "setuptools-scm>=8" wheel ninja py-cpuinfo build
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cu128

- name: Fetch CUTLASS headers
run: |
git clone --depth 1 --branch v3.9.2 https://github.com/NVIDIA/cutlass.git "${HOME}/cutlass"

# setuptools-scm derives the version from git history: a commit that is N
# commits after tag "vX.Y.Z" builds as "X.Y.(Z+1).devN". local_scheme in
# pyproject.toml strips the "+gHASH" suffix so the sdist is PyPI-valid.
- name: Build Wheel
shell: bash
env:
Expand All @@ -98,8 +77,7 @@ jobs:
export CUDA_HOME="/usr/local/cuda-${{ matrix.cuda-version }}"
export PATH="${CUDA_HOME}/bin:${PATH}"
export CUTLASS_DIR="${HOME}/cutlass"
VERSION_HASH=$(cat artifact/version.txt)
MOEINF_VERSION=${{ env.NIGHTLY_BASE_VERSION }}.dev${VERSION_HASH} python3 -m build --wheel --no-isolation
python3 -m build --wheel --no-isolation
wheel_name=$(ls dist/*whl | xargs -n 1 basename)
asset_name=${wheel_name//"linux"/"manylinux1"}
echo "wheel_name=${wheel_name}" >> $GITHUB_ENV
Expand All @@ -108,8 +86,7 @@ jobs:
- name: Build Source
if: ${{ matrix.python-version == '3.10' }}
run: |
VERSION_HASH=$(cat artifact/version.txt)
MOEINF_VERSION=${{ env.NIGHTLY_BASE_VERSION }}.dev${VERSION_HASH} python3 -m build --sdist
python3 -m build --sdist

- name: Rename Wheel
run: |
Expand All @@ -122,12 +99,12 @@ jobs:
cp dist/*.tar.gz sdist_only/

# Nightly publishes only the sdist to PyPI (see publish.yml for rationale).
# Auth via PyPI Trusted Publishing (OIDC) — no username/password needed;
# requires id-token: write (above) and a publisher registered on PyPI for
# this repo + workflow file. See RELEASE.md.
- name: Publish sdist to PyPI
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.python-version == '3.10' }}
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
skip-existing: true
packages-dir: sdist_only
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: write
id-token: write

jobs:
release:
Expand Down Expand Up @@ -47,6 +48,8 @@ jobs:
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Free Disk Space
run: |
Expand All @@ -71,7 +74,7 @@ jobs:
- name: Install Python build dependencies (torch matched to CUDA)
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "setuptools>=78.1.1,<82" wheel ninja py-cpuinfo build
python3 -m pip install "setuptools>=78.1.1,<82" "setuptools-scm>=8" wheel ninja py-cpuinfo build
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cu128

- name: Fetch CUTLASS headers
Expand Down Expand Up @@ -120,12 +123,12 @@ jobs:
# Only the sdist is published to PyPI. Prebuilt CUDA wheels are ABI-locked to a
# specific torch/CUDA, which PyPI wheel tags cannot express; they are attached to
# the GitHub Release instead. pip installs the sdist and compiles it locally.
# Auth via PyPI Trusted Publishing (OIDC) — no username/password needed;
# requires id-token: write (above) and a publisher registered on PyPI for
# this repo + workflow file. See RELEASE.md.
- name: Publish sdist to PyPI
if: ${{ matrix.python-version == '3.10' }}
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
skip-existing: true
packages-dir: sdist_only
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,6 @@ benchmarks/expert_io_microbench/results/
benchmarks/eval/__pycache__/
*.nsys-rep
*.sqlite

# setuptools-scm generated version file (regenerated on every build)
moe_infinity/_version.py
Loading
Loading