Skip to content
Draft
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
34 changes: 29 additions & 5 deletions .github/workflows/nvi-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,32 @@ jobs:
- name: Run checkstyle
run: make checkstyle

tests:
# tests:
# runs-on: ubuntu-latest
# needs: [checkstyle]
# env:
# MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
# MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}

# steps:
# - name: Checkout code
# uses: actions/checkout@v6

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

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install modal

# - name: Run tests
# run: |
# modal run dev.modal.tests

correctness:
runs-on: ubuntu-latest
needs: [checkstyle]
env:
Expand All @@ -63,15 +88,14 @@ jobs:

- name: Run tests
run: |
modal run dev.modal.tests
modal run dev.modal.test_correctness

tests-bwd:
convergence:
runs-on: ubuntu-latest
needs: [checkstyle]
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
REBUILD_IMAGE: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

steps:
- name: Checkout code
Expand All @@ -89,4 +113,4 @@ jobs:

- name: Run tests
run: |
modal run dev.modal.tests_bwd
modal run dev.modal.test_convergence
12 changes: 2 additions & 10 deletions dev/modal/tests_bwd.py → dev/modal/test_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

image = modal.Image.debian_slim(python_version=PYTHON_VERSION).pip_install("uv")

app = modal.App("liger_tests_bwd", image=image)
app = modal.App("liger_tests", image=image)

# mount: add local files to the remote container
repo = image.add_local_dir(ROOT_PATH, remote_path=REMOTE_ROOT_PATH)


@app.function(gpu="H100!", image=repo, timeout=90 * 60)
def liger_bwd_tests():
def liger_tests():
import subprocess

subprocess.run(
Expand All @@ -24,12 +24,4 @@ def liger_bwd_tests():
shell=True,
cwd=REMOTE_ROOT_PATH,
)
# force install transformers==4.49.0
subprocess.run(
["uv pip install transformers==4.49.0 --system"],
check=True,
shell=True,
cwd=REMOTE_ROOT_PATH,
)
subprocess.run(["make test"], check=True, shell=True, cwd=REMOTE_ROOT_PATH)
subprocess.run(["make test-convergence"], check=True, shell=True, cwd=REMOTE_ROOT_PATH)
27 changes: 27 additions & 0 deletions dev/modal/test_correctness.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from pathlib import Path

import modal

ROOT_PATH = Path(__file__).parent.parent.parent
REMOTE_ROOT_PATH = "/root/liger-kernel"
PYTHON_VERSION = "3.12"

image = modal.Image.debian_slim(python_version=PYTHON_VERSION).pip_install("uv")

app = modal.App("liger_tests", image=image)

# mount: add local files to the remote container
repo = image.add_local_dir(ROOT_PATH, remote_path=REMOTE_ROOT_PATH)


@app.function(gpu="H100!", image=repo, timeout=90 * 60)
def liger_tests():
import subprocess

subprocess.run(
["uv pip install -e '.[dev]' --system"],
check=True,
shell=True,
cwd=REMOTE_ROOT_PATH,
)
subprocess.run(["make test"], check=True, shell=True, cwd=REMOTE_ROOT_PATH)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_optional_dependencies():
"""Get optional dependency groups."""
return {
"dev": [
"transformers>=4.49.0",
"transformers==5.0.0rc3",
"matplotlib>=3.7.2",
"ruff>=0.12.0",
"pytest>=7.1.2",
Expand Down
Loading
Loading