fix default act quant setting #180
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 ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| python-version: ['3.10'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 pytest | |
| # Install PyTorch CPU version first to ensure correct torch backend | |
| pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | |
| # Install remaining requirements (torch/torchvision/torchaudio already satisfied above) | |
| # Note: pattern excludes exact package names to avoid overriding the CPU torch installation | |
| grep -v -E "^(torch|torchvision|torchaudio|torchcodec)([>=<~!]|$)" requirements.txt | pip install -r /dev/stdin | |
| # Install torchcodec separately as it may not be available in all CI environments | |
| pip install torchcodec || true | |
| - name: Lint with flake8 | |
| run: | | |
| # Stop the build if there are Python syntax errors or undefined names | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=TinyStories,output,benchmark_results,deploy,project,hw | |
| # Exit-zero treats all errors as warnings | |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=TinyStories,output,benchmark_results,deploy,project,hw | |
| - name: Run tests | |
| run: | | |
| export PYTHONPATH=$PYTHONPATH:. | |
| # Try pytest first, fallback to unittest if pytest is not suitable | |
| if [ -d tests ]; then | |
| pytest tests/ -v 2>/dev/null || python -m unittest discover -s tests -p "test_*.py" -v | |
| else | |
| echo "No tests directory found" | |
| exit 1 | |
| fi |