|
| 1 | +name: ROCm GPU CI |
| 2 | + |
| 3 | +on: |
| 4 | + # Trigger the workflow on push or pull request, |
| 5 | + # but only for the rocm-main branch |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - rocm-main |
| 9 | + - 'rocm-jaxlib-v*' |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - rocm-main |
| 13 | + - 'rocm-jaxlib-v*' |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + build-jax-in-docker: |
| 21 | + runs-on: mi-250 |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + python: ["3.10", "3.11", "3.12"] |
| 25 | + rocm: [ "6.3.3"] |
| 26 | + env: |
| 27 | + BASE_IMAGE: "ubuntu:22.04" |
| 28 | + TEST_IMAGE: ubuntu-jax-${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }} |
| 29 | + PYTHON_VERSION: ${{ matrix.python }} |
| 30 | + ROCM_VERSION: ${{ matrix.rocm }} |
| 31 | + WORKSPACE_DIR: workdir_${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }} |
| 32 | + steps: |
| 33 | + - name: Clean up old runs |
| 34 | + run: | |
| 35 | + ls |
| 36 | + # Make sure that we own all of the files so that we have permissions to delete them |
| 37 | + docker run -v "./:/jax" ubuntu /bin/bash -c "chown -R $UID /jax/workdir_* || true" |
| 38 | + # Remove any old work directories from this machine |
| 39 | + rm -rf workdir_* |
| 40 | + ls |
| 41 | + - name: Print system info |
| 42 | + run: | |
| 43 | + whoami |
| 44 | + printenv |
| 45 | + df -h |
| 46 | + rocm-smi |
| 47 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 48 | + with: |
| 49 | + path: ${{ env.WORKSPACE_DIR }} |
| 50 | + - name: Build JAX |
| 51 | + run: | |
| 52 | + pushd $WORKSPACE_DIR |
| 53 | + python3 build/rocm/ci_build \ |
| 54 | + --rocm-version $ROCM_VERSION \ |
| 55 | + --base-docker $BASE_IMAGE \ |
| 56 | + --python-versions $PYTHON_VERSION \ |
| 57 | + --compiler=clang \ |
| 58 | + dist_docker \ |
| 59 | + --image-tag $TEST_IMAGE |
| 60 | + - name: Archive jax wheels |
| 61 | + uses: actions/upload-artifact@v4 |
| 62 | + with: |
| 63 | + name: rocm_jax_r${{ env.ROCM_VERSION }}_py${{ env.PYTHON_VERSION }}_id${{ github.run_id }} |
| 64 | + path: ./dist/*.whl |
| 65 | + - name: Run tests |
| 66 | + env: |
| 67 | + GPU_COUNT: "8" |
| 68 | + GFX: "gfx90a" |
| 69 | + run: | |
| 70 | + cd $WORKSPACE_DIR |
| 71 | + python3 build/rocm/ci_build test $TEST_IMAGE --test-cmd "pytest tests/core_test.py" |
| 72 | +
|
0 commit comments