Repository navigation
fix: correct CUDA wheel builds and prebuilt extension loading #19
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: Requirements Compatibility | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/requirements_compatibility.yml" | |
| - ".pre-commit-config.yaml" | |
| - "applications/*/setup.py" | |
| - "applications/ColossalChat/coati/distributed/reward/code_reward/testing_util.py" | |
| - "applications/ColossalChat/requirements.txt" | |
| - "applications/ColossalChat/tests/test_code_reward_testing_util.py" | |
| - "examples/community/roberta/pretraining/model/deberta_v2.py" | |
| - "examples/images/diffusion/ldm/modules/image_degradation/utils_image.py" | |
| - "requirements/**" | |
| - "setup.py" | |
| - "tests/test_cluster/test_process_group_mesh.py" | |
| jobs: | |
| compatibility: | |
| name: Python ${{ matrix.python-version }} / ${{ matrix.numpy-requirement }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: "3.10" | |
| numpy-requirement: "numpy==1.26.*" | |
| - python-version: "3.10" | |
| numpy-requirement: "numpy>=2,<3" | |
| - python-version: "3.11" | |
| numpy-requirement: "numpy>=2,<3" | |
| - python-version: "3.12" | |
| numpy-requirement: "numpy>=2,<3" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: requirements/requirements.txt | |
| - name: Install compatibility test dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/cpu | |
| python -m pip install "${{ matrix.numpy-requirement }}" packaging psutil pytest ruff==0.16.9 | |
| python -m pip install --no-deps -e . | |
| - name: Verify package metadata | |
| run: | | |
| python - <<'PY' | |
| from importlib.metadata import metadata, requires | |
| from packaging.requirements import Requirement | |
| from packaging.specifiers import SpecifierSet | |
| from packaging.version import Version | |
| package_metadata = metadata("colossalai") | |
| python_versions = SpecifierSet(package_metadata["Requires-Python"]) | |
| assert Version("3.9") not in python_versions | |
| assert all(Version(version) in python_versions for version in ("3.10", "3.11", "3.12")) | |
| assert Version("3.13") not in python_versions | |
| requirements = { | |
| Requirement(item).name.lower(): Requirement(item) | |
| for item in requires("colossalai") or [] | |
| } | |
| assert "pre-commit" not in requirements | |
| # Keep the CPU baseline installable while allowing the GPU CI profile. | |
| torch_versions = requirements["torch"].specifier | |
| assert Version("2.5.1") in torch_versions | |
| assert Version("2.13.0+cu130") in torch_versions | |
| assert Version("2.14.0") not in torch_versions | |
| PY | |
| - name: Check removed NumPy APIs | |
| run: ruff check --select NPY201 colossalai tests applications examples | |
| - name: Run compatibility smoke tests | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| # Keep the repository root on sys.path for applications.* imports. | |
| python -m pytest -m cpu tests/test_cluster/test_process_group_mesh.py | |
| python -m pytest applications/ColossalChat/tests/test_code_reward_testing_util.py |