Fixed beta estimation instability on gpu #161
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: CI | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master, develop] | |
| env: | |
| NUMBA_CACHE_DIR: /tmp/numba_cache | |
| jobs: | |
| test: | |
| name: Test - Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-cov | |
| pip install -e . | |
| - name: Print versions | |
| run: | | |
| python --version | |
| python -c "import numpy; print(f'numpy: {numpy.__version__}')" | |
| python -c "import torch; print(f'torch: {torch.__version__}')" | |
| python -c "import numba; print(f'numba: {numba.__version__}')" | |
| - name: Run tests | |
| run: | | |
| pytest tests/ -v --tb=short -m "not gpu and not slow" --cov=torchref --cov-report=xml | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.python-version == '3.11' | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install linters | |
| run: | | |
| pip install ruff black isort | |
| - name: Run ruff | |
| run: ruff check torchref/ --output-format=github || true | |
| - name: Check black formatting | |
| run: black --check torchref/ || true | |
| - name: Check import sorting | |
| run: isort --check-only torchref/ || true |