|
86 | 86 | - name: Check |
87 | 87 | run: uv run pyright |
88 | 88 |
|
| 89 | + benchmark-smoke: |
| 90 | + if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' |
| 91 | + timeout-minutes: 10 |
| 92 | + runs-on: ubuntu-slim |
| 93 | + env: |
| 94 | + NUMBA_CACHE_DIR: ${{ github.workspace }}/.cache/numba |
| 95 | + # Cached machine code must be portable across hosted runner CPU models. |
| 96 | + NUMBA_CPU_NAME: generic |
| 97 | + NUMBA_NUM_THREADS: "1" |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v6.0.2 |
| 100 | + with: |
| 101 | + ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} |
| 102 | + persist-credentials: false |
| 103 | + - name: Install uv |
| 104 | + uses: astral-sh/setup-uv@v8.0.0 |
| 105 | + with: |
| 106 | + python-version: '3.11' |
| 107 | + # Numba validates disk caches with source mtime and size; hashFiles guards content. |
| 108 | + - name: Normalize Numba source timestamps |
| 109 | + run: find src/unilab benchmark -type f -name '*numba*.py' -exec touch -d @946684800 {} + |
| 110 | + - name: Restore Numba cache |
| 111 | + uses: actions/cache@v4 |
| 112 | + with: |
| 113 | + path: ${{ env.NUMBA_CACHE_DIR }} |
| 114 | + key: numba-v1-${{ runner.os }}-${{ runner.arch }}-py311-${{ hashFiles('uv.lock', 'src/unilab/**/*numba*.py', 'benchmark/**/*numba*.py') }} |
| 115 | + - name: Install dependencies |
| 116 | + run: | |
| 117 | + uv sync --extra mujoco \ |
| 118 | + --no-install-package torch \ |
| 119 | + --no-install-package nvidia-cublas-cu12 \ |
| 120 | + --no-install-package nvidia-cuda-cupti-cu12 \ |
| 121 | + --no-install-package nvidia-cuda-nvrtc-cu12 \ |
| 122 | + --no-install-package nvidia-cuda-runtime-cu12 \ |
| 123 | + --no-install-package nvidia-cudnn-cu12 \ |
| 124 | + --no-install-package nvidia-cufft-cu12 \ |
| 125 | + --no-install-package nvidia-cufile-cu12 \ |
| 126 | + --no-install-package nvidia-curand-cu12 \ |
| 127 | + --no-install-package nvidia-cusolver-cu12 \ |
| 128 | + --no-install-package nvidia-cusparse-cu12 \ |
| 129 | + --no-install-package nvidia-cusparselt-cu12 \ |
| 130 | + --no-install-package nvidia-nccl-cu12 \ |
| 131 | + --no-install-package nvidia-nvjitlink-cu12 \ |
| 132 | + --no-install-package nvidia-nvtx-cu12 \ |
| 133 | + --no-install-package triton |
| 134 | + uv pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu |
| 135 | + - name: Benchmark entrypoint smoke test |
| 136 | + run: uv run --no-sync python benchmark/smoke_test.py |
| 137 | + - name: Numba benchmark contracts |
| 138 | + run: | |
| 139 | + uv run --no-sync pytest -q \ |
| 140 | + benchmark/env/test_g1_joystick_numba_benchmark.py \ |
| 141 | + benchmark/env/test_g1_motion_tracking_numba_benchmark.py \ |
| 142 | + benchmark/env/test_numba_random_noise_benchmark.py |
| 143 | +
|
89 | 144 | test: |
90 | 145 | if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' |
91 | 146 | strategy: |
@@ -125,7 +180,5 @@ jobs: |
125 | 180 | --no-install-package nvidia-nvtx-cu12 \ |
126 | 181 | --no-install-package triton |
127 | 182 | uv pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu |
128 | | - - name: Benchmark entrypoint smoke test |
129 | | - run: uv run --no-sync python benchmark/smoke_test.py |
130 | 183 | - name: Test with coverage |
131 | 184 | run: uv run --no-sync pytest -m "not slow" --cov=src/unilab --cov-report "markdown-append:${GITHUB_STEP_SUMMARY:-/dev/null}" --cov-fail-under=25 |
0 commit comments