From df1d6302f2e94bff4ab3a429e7043d1d9e835341 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sat, 20 Sep 2025 22:17:39 -0400 Subject: [PATCH 1/8] ci: use a shared workflow --- .github/workflows/CI-localjll.yml | 158 ++--------------------- .github/workflows/CI.yml | 184 ++++++++------------------- .github/workflows/CommonCI.yml | 205 ++++++++++++++++++++++++++++++ .github/workflows/downgrade.yml | 96 -------------- 4 files changed, 268 insertions(+), 375 deletions(-) create mode 100644 .github/workflows/CommonCI.yml delete mode 100644 .github/workflows/downgrade.yml diff --git a/.github/workflows/CI-localjll.yml b/.github/workflows/CI-localjll.yml index f1f123dea7..74e64565f7 100644 --- a/.github/workflows/CI-localjll.yml +++ b/.github/workflows/CI-localjll.yml @@ -9,7 +9,7 @@ on: branches: - main - release-* - tags: '*' + tags: ['*'] paths: - '.github/workflows/CI-localjll.yml' - 'deps/**' @@ -21,157 +21,23 @@ concurrency: cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - local libReactant - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - container: - image: ${{ contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images@sha256:7004a6ebbdd77bd047900b2bffc542e8576864056dc27a9c94d30666d6f7ea01' || '' }} + test-localjll: strategy: fail-fast: false matrix: version: - - '1.10' - - '1.11' + - "1.10" + - "1.11" os: - linux-x86-n2-32 - macOS-latest exclude: - os: macOS-latest - version: '1.10' - steps: - - name: Free Disk Space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - if: ${{ startsWith(matrix.os, 'ubuntu-') }} - - name: Clean `/opt` - run: sudo rm -rf /opt/* - if: ${{ startsWith(matrix.os, 'ubuntu-') }} - - uses: actions/checkout@v5 - - name: Set and create TMPDIR - # We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub - # is terrible and the two don't match inside containers: - # https://github.com/actions/runner/issues/2058 - run: | - export TMPDIR="${GITHUB_WORKSPACE}/tmp" - echo "TMPDIR=${TMPDIR}" >> "${GITHUB_ENV}" - - mkdir -pv "${TMPDIR}" - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - - name: Load Julia packages from cache - id: julia-cache - uses: julia-actions/cache@v2 - - uses: bazel-contrib/setup-bazel@0.15.0 - name: Set up Bazel - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Store build cache per workflow. - disk-cache: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.version }} - # Share repository cache between workflows. - repository-cache: true - bazelisk-version: 1.x - - name: Prepare build on macOS - if: ${{ startsWith(matrix.os, 'macOS-') }} - run: | - echo "SDKROOT=$(xcrun --show-sdk-path)" >> "${GITHUB_ENV}" - - name: Install numpy - if: ${{ startsWith(matrix.os, 'macOS-') }} - run: | - python -m pip install numpy - - name: Build libReactant - timeout-minutes: 120 - run: | - julia --color=yes --project=deps -e 'using Pkg; Pkg.instantiate()' - julia --color=yes --project=deps deps/build_local.jl - cp LocalPreferences.toml test/ - - name: "Setup Runtime Preferences" - run: | - import Pkg - Pkg.Registry.update() - Pkg.instantiate() - using Preferences - Preferences.set_preferences!("Reactant", "xla_runtime" => "PJRT"; force=true) - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - env: - JULIA_PKG_PRECOMPILE_AUTO: 0 - - name: "Install Dependencies" - run: | - import Pkg - Pkg.Registry.update() - # Install packages present in subdirectories - dev_pks = Pkg.PackageSpec[] - for path in ("lib/ReactantCore",) - push!(dev_pks, Pkg.PackageSpec(; path)) - end - Pkg.develop(dev_pks) - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - # Only in Julia v1.10 we need to install `ReactantCore` manually. - if: ${{ matrix.version == '1.10' }} - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - - name: "Run Tests: PJRT" - timeout-minutes: 200 - run: | - import Pkg - Pkg.Registry.update() - Pkg.test(; coverage="user") - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - XLA_FLAGS: "--xla_force_host_platform_device_count=12" - JULIA_DEBUG: "Reactant,Reactant_jll" - - name: Upload MLIR modules (PJRT) - uses: actions/upload-artifact@v4 - timeout-minutes: 10 - if: ${{ always() }} - with: - name: "mlir-localjll-PJRT-${{ matrix.version }}-${{ matrix.os }}-${{ github.event_name }}" - path: "**/*.mlir" - retention-days: 90 - overwrite: false - - name: "Setup Runtime Preferences" - run: | - import Pkg - Pkg.Registry.update() - Pkg.instantiate() - using Preferences - Preferences.set_preferences!("Reactant", "xla_runtime" => "IFRT"; force=true) - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - env: - JULIA_PKG_PRECOMPILE_AUTO: 0 - - name: "Run Tests: IFRT" - timeout-minutes: 200 - run: | - import Pkg - Pkg.Registry.update() - Pkg.test(; coverage="user") - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - XLA_FLAGS: "--xla_force_host_platform_device_count=12" - JULIA_DEBUG: "Reactant,Reactant_jll" - - name: Upload MLIR modules (IFRT) - uses: actions/upload-artifact@v4 - timeout-minutes: 10 - if: ${{ always() }} - with: - name: "mlir-localjll-IFRT-${{ matrix.version }}-${{ matrix.os }}-${{ github.event_name }}" - path: "**/*.mlir" - retention-days: 90 - overwrite: false - - name: Save Julia depot cache on cancel or failure - id: julia-cache-save - if: cancelled() || failure() - uses: actions/cache/save@v4 - with: - path: | - ${{ steps.julia-cache.outputs.cache-paths }} - key: ${{ steps.julia-cache.outputs.cache-key }} - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v5 - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} + version: "1.10" + uses: ./.github/workflows/CommonCI.yml + with: + julia_version: ${{ matrix.version }} + os: ${{ matrix.os }} + runtime: "both" + assertions: false + localjll: true diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c7ca2511cd..0acd10ca52 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ on: branches: - main - release-* - tags: "*" + tags: ["*"] paths: - ".github/workflows/CI.yml" - "ext/**" @@ -30,11 +30,6 @@ concurrency: jobs: test: - timeout-minutes: 90 - name: Julia ${{ matrix.version }} - ${{ matrix.test_group }} - ${{ matrix.os }} - ${{ matrix.runtime }} - assertions=${{ matrix.assertions }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - container: - image: ${{ contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images:main' || '' }} strategy: fail-fast: false matrix: @@ -52,137 +47,60 @@ jobs: # - macOS-13 - macOS-latest - windows-latest + - linux-x86-ct6e-180-4tpu test_group: - core - neural_networks - integration runtime: - - "PJRT" - - "IFRT" - assertions: - - false - include: + - "pjrt" + - "ifrt" + exclude: - os: linux-x86-ct6e-180-4tpu - version: "1.11" - assertions: false - test_group: core - runtime: "IFRT" - - os: linux-x86-ct6e-180-4tpu - version: "1.11" - assertions: false - test_group: integration - runtime: "IFRT" - - os: linux-x86-ct6e-180-4tpu - version: "1.11" - assertions: false - test_group: neural_networks - runtime: "IFRT" - - os: ubuntu-24.04 - version: "1.10" - assertions: true - test_group: core - runtime: "PJRT" - - os: ubuntu-24.04 - version: "1.10" - assertions: true - test_group: neural_networks - runtime: "PJRT" - - os: ubuntu-24.04 version: "1.10" - assertions: true - test_group: integration - runtime: "PJRT" - - os: ubuntu-24.04 - libReactant: packaged - version: '1.10' - test_group: core - - os: ubuntu-24.04 - libReactant: packaged - version: '1.10' - test_group: neural_networks - - os: ubuntu-24.04 - libReactant: packaged - version: '1.10' - test_group: integration - steps: - - name: Set TMPDIR - # We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub - # is terrible and the two don't match inside containers: - # https://github.com/actions/runner/issues/2058 - - if: ${{ matrix.os != 'windows-latest' }} - run: | - echo "TMPDIR=${GITHUB_WORKSPACE}/tmp" >> ${GITHUB_ENV} - - uses: actions/checkout@v5 - - name: Create TMPDIR - if: ${{ matrix.os != 'windows-latest' }} - run: | - mkdir -p ${{ env.TMPDIR }} - - uses: julia-actions/setup-julia@v2 - if: ${{ ! matrix.assertions }} - with: - version: ${{ matrix.version }} - - uses: julia-actions/cache@v2 - - uses: actions/checkout@v5 - if: ${{ matrix.assertions }} - with: - repository: "JuliaLang/julia" - ref: release-${{ matrix.version }} - path: "julia" - - name: Compile Julia - if: ${{ matrix.assertions }} - run: | - sed -i.bak 's/exit 2/exit 0/g' julia/deps/tools/jlchecksum - make -C julia -j $(nproc) FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1 JULIA_PRECOMPILE=0 - echo $PWD/julia/usr/bin >> $GITHUB_PATH - - name: "Setup Runtime Preferences" - uses: "DamianReeves/write-file-action@master" - with: - path: "LocalPreferences.toml" - write-mode: "overwrite" - contents: | - [Reactant] - xla_runtime = "${{ matrix.runtime }}" - - name: "Install Dependencies" - run: | - import Pkg - Pkg.Registry.update() - # Install packages present in subdirectories - dev_pks = Pkg.PackageSpec[] - for path in ("lib/ReactantCore",) - push!(dev_pks, Pkg.PackageSpec(; path)) - end - Pkg.develop(dev_pks) - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - # Only in Julia v1.10 we need to install `ReactantCore` manually. - if: ${{ matrix.version == '1.10' }} - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - - name: "Run Tests" - timeout-minutes: 60 - run: | - import Pkg - Pkg.Registry.update() - Pkg.test(; coverage="user") - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - id: run_tests - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - ENABLE_PJRT_COMPATIBILITY: 1 - REACTANT_TEST_GROUP: ${{ matrix.test_group }} - XLA_FLAGS: "--xla_force_host_platform_device_count=12" - JULIA_DEBUG: "Reactant,Reactant_jll" - - name: Upload MLIR modules - uses: actions/upload-artifact@v4 - timeout-minutes: 10 - if: ${{ always() }} - with: - name: "mlir-${{ matrix.version }}-${{ matrix.test_group }}-${{ matrix.os }}-${{ matrix.runtime }}-assertions=${{ matrix.assertions }}-${{ github.event_name }}" - path: "**/*.mlir" - retention-days: 90 - overwrite: false - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v5 - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} + - os: linux-x86-ct6e-180-4tpu + runtime: "pjrt" + uses: ./.github/workflows/CommonCI.yml + with: + julia_version: ${{ matrix.version }} + os: ${{ matrix.os }} + runtime: ${{ matrix.runtime }} + test_group: ${{ matrix.test_group }} + + test-assertions: + strategy: + fail-fast: false + matrix: + version: + - "1.10" + - "1.11" + test_group: + - core + - neural_networks + - integration + uses: ./.github/workflows/CommonCI.yml + with: + julia_version: ${{ matrix.version }} + os: "ubuntu-24.04" + runtime: "both" + assertions: true + test_group: ${{ matrix.test_group }} + + downgrade: + strategy: + fail-fast: false + matrix: + test_group: + - core + - neural_networks + - integration + runtime: + - "pjrt" + - "ifrt" + uses: ./.github/workflows/CommonCI.yml + with: + julia_version: "1.10" + os: "ubuntu-24.04" + runtime: ${{ matrix.runtime }} + test_group: ${{ matrix.test_group }} + downgrade_testing: true diff --git a/.github/workflows/CommonCI.yml b/.github/workflows/CommonCI.yml new file mode 100644 index 0000000000..f7828bcd13 --- /dev/null +++ b/.github/workflows/CommonCI.yml @@ -0,0 +1,205 @@ +name: Common Reactant CI Workflow + +on: + workflow_call: + inputs: + julia_version: + description: "Julia version" + required: true + type: string + os: + description: "OS" + required: true + type: string + runtime: + description: "XLA Runtime (pjrt | ifrt | both)" + required: true + type: string + assertions: + description: "Enable assertions" + required: false + default: false + type: boolean + localjll: + description: "Use local libReactant" + required: false + default: false + type: boolean + test_group: + description: "Test group" + required: false + default: "all" + type: string + downgrade_testing: + description: "Downgrade testing" + required: false + default: false + type: boolean + +jobs: + test: + runs-on: ${{ inputs.os }} + container: + image: ${{ contains(inputs.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images:main' || '' }} + steps: + - name: Free Disk Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + if: ${{ startsWith(inputs.os, 'ubuntu-') && inputs.localjll }} + - name: Clean `/opt` + run: sudo rm -rf /opt/* + if: ${{ startsWith(inputs.os, 'ubuntu-') && inputs.localjll }} + + # XXX: I don't know why this isn't creating a dir + # - name: Set TMPDIR + # # We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub + # # is terrible and the two don't match inside containers: + # # https://github.com/actions/runner/issues/2058 + # if: ${{ inputs.os != 'windows-latest' }} + # run: | + # echo "TMPDIR=${GITHUB_WORKSPACE}/tmp" >> ${GITHUB_ENV} + # - name: Make TMPDIR + # if: ${{ inputs.os != 'windows-latest' }} + # run: | + # mkdir -p ${{ env.TMPDIR }} + + - uses: actions/checkout@v5 + - uses: julia-actions/setup-julia@v2 + if: ${{ ! inputs.assertions }} + with: + version: ${{ inputs.julia_version }} + - uses: julia-actions/cache@v2 + id: julia-cache + + - uses: julia-actions/julia-downgrade-compat@v2 + if: ${{ inputs.downgrade_testing }} + with: + skip: "ReactantCore" + julia_version: ${{ inputs.julia_version }} + + # Local build of libReactant + - uses: bazel-contrib/setup-bazel@0.15.0 + if: ${{ inputs.localjll }} + name: Set up Bazel + with: + # Avoid downloading Bazel every time. + bazelisk-cache: true + # Store build cache per workflow. + disk-cache: ${{ github.workflow }}-${{ inputs.os }}-${{ inputs.julia_version }} + # Share repository cache between workflows. + repository-cache: true + bazelisk-version: 1.x + - name: Prepare build on macOS + if: ${{ startsWith(inputs.os, 'macOS-') && inputs.localjll }} + run: | + echo "SDKROOT=$(xcrun --show-sdk-path)" >> "${GITHUB_ENV}" + - name: Install numpy + if: ${{ startsWith(inputs.os, 'macOS-') && inputs.localjll }} + run: | + python -m pip install numpy + - name: Build libReactant + timeout-minutes: 120 + if: ${{ inputs.localjll }} + run: | + julia --color=yes --project=deps -e 'using Pkg; Pkg.instantiate()' + julia --color=yes --project=deps deps/build_local.jl + cp LocalPreferences.toml test/ + + # Compile Julia if assertions are enabled + - uses: actions/checkout@v5 + if: ${{ inputs.assertions }} + with: + repository: "JuliaLang/julia" + ref: release-${{ inputs.julia_version }} + path: "julia" + - name: Compile Julia + if: ${{ inputs.assertions }} + run: | + sed -i.bak 's/exit 2/exit 0/g' julia/deps/tools/jlchecksum + make -C julia -j $(nproc) FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1 JULIA_PRECOMPILE=0 + echo $PWD/julia/usr/bin >> $GITHUB_PATH + + # Install dependencies (specifically ReactantCore subdirectory for 1.10) + - name: "Install Dependencies" + run: | + import Pkg + Pkg.Registry.update() + # Install packages present in subdirectories + dev_pks = Pkg.PackageSpec[] + for path in ("lib/ReactantCore",) + push!(dev_pks, Pkg.PackageSpec(; path)) + end + Pkg.develop(dev_pks) + shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} + # Only in Julia v1.10 we need to install `ReactantCore` manually. + if: ${{ inputs.julia_version == '1.10' || inputs.julia_version == 'lts' }} + env: + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + + # Run the tests (pjrt or ifrt or both) + - name: "Setup Runtime Preferences (PJRT)" + if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }} + uses: "DamianReeves/write-file-action@master" + with: + path: "LocalPreferences.toml" + write-mode: "overwrite" + contents: | + [Reactant] + xla_runtime = "PJRT" + - name: "Run Tests (PJRT)" + timeout-minutes: 60 + if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }} + uses: julia-actions/julia-runtest@v1 + env: + ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }} + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + ENABLE_PJRT_COMPATIBILITY: 1 + REACTANT_TEST_GROUP: ${{ inputs.test_group }} + XLA_FLAGS: "--xla_force_host_platform_device_count=12" + JULIA_DEBUG: "Reactant,Reactant_jll" + + - name: "Setup Runtime Preferences (IFRT)" + if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }} + uses: "DamianReeves/write-file-action@master" + with: + path: "LocalPreferences.toml" + write-mode: "overwrite" + contents: | + [Reactant] + xla_runtime = "IFRT" + - name: "Run Tests (IFRT)" + timeout-minutes: 60 + if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }} + uses: julia-actions/julia-runtest@v1 + env: + ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }} + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + ENABLE_PJRT_COMPATIBILITY: 1 + REACTANT_TEST_GROUP: ${{ inputs.test_group }} + XLA_FLAGS: "--xla_force_host_platform_device_count=12" + JULIA_DEBUG: "Reactant,Reactant_jll" + + - name: "Upload MLIR modules" + uses: actions/upload-artifact@v4 + timeout-minutes: 10 + if: ${{ always() }} + with: + name: "mlir-${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}" + path: "**/*.mlir" + retention-days: 90 + overwrite: false + + - name: Save Julia depot cache on cancel or failure + if: ${{ inputs.localjll && (cancelled() || failure()) }} + uses: actions/cache/save@v4 + with: + path: | + ${{ steps.julia-cache.outputs.cache-paths }} + key: ${{ steps.julia-cache.outputs.cache-key }} + + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v5 + with: + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/downgrade.yml b/.github/workflows/downgrade.yml deleted file mode 100644 index 8f30a32878..0000000000 --- a/.github/workflows/downgrade.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Downgrade - -on: - pull_request: - branches: - - main - paths: - - '.github/workflows/downgrade.yml' - - 'ext/**' - - 'lib/**' - - 'src/**' - - 'Project.toml' - push: - branches: - - main - paths: - - '.github/workflows/downgrade.yml' - - 'ext/**' - - 'lib/**' - - 'src/**' - - 'Project.toml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - downgrade: - # if: ${{ !contains(github.event.head_commit.message, '[skip tests]') && github.base_ref == github.event.repository.default_branch }} - timeout-minutes: 90 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - test_group: - - core - - neural_networks - - integration - runtime: - - PJRT - - IFRT - env: - TMPDIR: ${{ github.workspace }}/tmp - steps: - - uses: actions/checkout@v5 - - name: Create TMPDIR - run: | - mkdir -p ${{ env.TMPDIR }} - - uses: julia-actions/setup-julia@v2 - with: - version: "1.10" - - uses: julia-actions/cache@v2 - - uses: julia-actions/julia-downgrade-compat@v2 - with: - skip: "ReactantCore" - - name: "Setup Runtime Preferences" - uses: "DamianReeves/write-file-action@master" - with: - path: "LocalPreferences.toml" - write-mode: "overwrite" - contents: | - [Reactant] - xla_runtime = "${{ matrix.runtime }}" - - name: "Install Dependencies and Run Tests" - run: | - import Pkg - Pkg.Registry.update() - # Install packages present in subdirectories - dev_pks = Pkg.PackageSpec[] - for path in ("lib/ReactantCore",) - push!(dev_pks, Pkg.PackageSpec(; path)) - end - Pkg.develop(dev_pks) - Pkg.test(; coverage="user", allow_reresolve=false) - shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} - id: run_tests - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - REACTANT_TEST_GROUP: ${{ matrix.test_group }} - XLA_FLAGS: "--xla_force_host_platform_device_count=12" - JULIA_DEBUG: "Reactant,Reactant_jll" - - name: Upload MLIR modules - uses: actions/upload-artifact@v4 - timeout-minutes: 10 - if: ${{ always() }} - with: - name: "mlir-downgrade-${{ matrix.test_group }}-${{ matrix.runtime }}-${{ github.event_name }}" - path: "**/*.mlir" - retention-days: 90 - overwrite: false - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v5 - with: - files: lcov.info From 9131bc76a99927f706c529562a40e9dcf1186487 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sun, 21 Sep 2025 11:05:59 -0400 Subject: [PATCH 2/8] ci: disable assertions for now --- .github/workflows/CI.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0acd10ca52..9d38b2e705 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -67,24 +67,24 @@ jobs: runtime: ${{ matrix.runtime }} test_group: ${{ matrix.test_group }} - test-assertions: - strategy: - fail-fast: false - matrix: - version: - - "1.10" - - "1.11" - test_group: - - core - - neural_networks - - integration - uses: ./.github/workflows/CommonCI.yml - with: - julia_version: ${{ matrix.version }} - os: "ubuntu-24.04" - runtime: "both" - assertions: true - test_group: ${{ matrix.test_group }} + # This has been broken for a while, originating from Enzyme.jl + # test-assertions: + # strategy: + # fail-fast: false + # matrix: + # version: + # - "1.10" + # test_group: + # - core + # - neural_networks + # - integration + # uses: ./.github/workflows/CommonCI.yml + # with: + # julia_version: ${{ matrix.version }} + # os: "ubuntu-24.04" + # runtime: "both" + # assertions: true + # test_group: ${{ matrix.test_group }} downgrade: strategy: From 35170854dd8b085e64b351719a7de7e2dcd09a19 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sun, 21 Sep 2025 11:45:37 -0400 Subject: [PATCH 3/8] ci: run tests --- .github/workflows/CommonCI.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CommonCI.yml b/.github/workflows/CommonCI.yml index f7828bcd13..3ddc7158eb 100644 --- a/.github/workflows/CommonCI.yml +++ b/.github/workflows/CommonCI.yml @@ -149,12 +149,17 @@ jobs: xla_runtime = "PJRT" - name: "Run Tests (PJRT)" timeout-minutes: 60 - if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }} - uses: julia-actions/julia-runtest@v1 + run: | + import Pkg + Pkg.Registry.update() + Pkg.test(; + coverage="user", + allow_reresolve=parse(Bool, get(ENV, "ALLOW_RERESOLVE", "true")) + ) + shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} env: ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }} JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - ENABLE_PJRT_COMPATIBILITY: 1 REACTANT_TEST_GROUP: ${{ inputs.test_group }} XLA_FLAGS: "--xla_force_host_platform_device_count=12" JULIA_DEBUG: "Reactant,Reactant_jll" @@ -170,12 +175,17 @@ jobs: xla_runtime = "IFRT" - name: "Run Tests (IFRT)" timeout-minutes: 60 - if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }} - uses: julia-actions/julia-runtest@v1 + run: | + import Pkg + Pkg.Registry.update() + Pkg.test(; + coverage="user", + allow_reresolve=parse(Bool, get(ENV, "ALLOW_RERESOLVE", "true")) + ) + shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} env: ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }} JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - ENABLE_PJRT_COMPATIBILITY: 1 REACTANT_TEST_GROUP: ${{ inputs.test_group }} XLA_FLAGS: "--xla_force_host_platform_device_count=12" JULIA_DEBUG: "Reactant,Reactant_jll" From 62ab553ee3c7dfec56fd55c393492485bb40c6da Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sun, 21 Sep 2025 11:50:35 -0400 Subject: [PATCH 4/8] test: remove unused deps --- test/Project.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 9b2dc1873c..05b1e8906a 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -18,7 +18,6 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Lux = "b2108857-7c20-44ae-9111-449ecde12c47" LuxLib = "82251201-b29d-42c6-8e01-566dec8acb11" -MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54" MethodAnalysis = "85b6ec6f-f7df-4429-9514-a64bcd9ee824" NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" @@ -54,7 +53,6 @@ KernelAbstractions = "0.9.30" LinearAlgebra = "1.10" Lux = "1.21" LuxLib = "1.11" -MLUtils = "0.4.4" NNlib = "0.9.26" OffsetArrays = "1" OneHotArrays = "0.2.6" From fc1c4590f8e9dc0c976faefbcd6f501a8ef8c3db Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sun, 21 Sep 2025 12:22:51 -0400 Subject: [PATCH 5/8] ci: fix common script --- .github/workflows/CommonCI.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CommonCI.yml b/.github/workflows/CommonCI.yml index 3ddc7158eb..cc045f3ce1 100644 --- a/.github/workflows/CommonCI.yml +++ b/.github/workflows/CommonCI.yml @@ -51,20 +51,18 @@ jobs: run: sudo rm -rf /opt/* if: ${{ startsWith(inputs.os, 'ubuntu-') && inputs.localjll }} - # XXX: I don't know why this isn't creating a dir - # - name: Set TMPDIR - # # We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub - # # is terrible and the two don't match inside containers: - # # https://github.com/actions/runner/issues/2058 - # if: ${{ inputs.os != 'windows-latest' }} - # run: | - # echo "TMPDIR=${GITHUB_WORKSPACE}/tmp" >> ${GITHUB_ENV} - # - name: Make TMPDIR - # if: ${{ inputs.os != 'windows-latest' }} - # run: | - # mkdir -p ${{ env.TMPDIR }} - - uses: actions/checkout@v5 + + - name: Set TMPDIR and create directory + # We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub + # is terrible and the two don't match inside containers: + # https://github.com/actions/runner/issues/2058 + if: ${{ !startsWith(inputs.os, 'windows-') }} + run: | + export TMPDIR="${GITHUB_WORKSPACE}/tmp" + mkdir -p "$TMPDIR" + echo "TMPDIR=$TMPDIR" >> $GITHUB_ENV + - uses: julia-actions/setup-julia@v2 if: ${{ ! inputs.assertions }} with: @@ -148,6 +146,7 @@ jobs: [Reactant] xla_runtime = "PJRT" - name: "Run Tests (PJRT)" + if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }} timeout-minutes: 60 run: | import Pkg @@ -174,6 +173,7 @@ jobs: [Reactant] xla_runtime = "IFRT" - name: "Run Tests (IFRT)" + if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }} timeout-minutes: 60 run: | import Pkg From 91f660cc34f48a20c5690efbe57040e860563cf6 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sun, 21 Sep 2025 14:07:46 -0400 Subject: [PATCH 6/8] ci: fix cache name --- .github/workflows/CI.yml | 2 +- .github/workflows/CommonCI.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9d38b2e705..b60f801cbc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -67,7 +67,7 @@ jobs: runtime: ${{ matrix.runtime }} test_group: ${{ matrix.test_group }} - # This has been broken for a while, originating from Enzyme.jl + # This has been broken for a while, originating from CUDA.jl # test-assertions: # strategy: # fail-fast: false diff --git a/.github/workflows/CommonCI.yml b/.github/workflows/CommonCI.yml index cc045f3ce1..6ff38ad933 100644 --- a/.github/workflows/CommonCI.yml +++ b/.github/workflows/CommonCI.yml @@ -69,6 +69,8 @@ jobs: version: ${{ inputs.julia_version }} - uses: julia-actions/cache@v2 id: julia-cache + with: + cache-name: julia-cache;workflow=${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}-${{ inputs.test_group }}-${{ inputs.downgrade_testing }}-${{ inputs.localjll }} - uses: julia-actions/julia-downgrade-compat@v2 if: ${{ inputs.downgrade_testing }} From 9f70508f619c947fc427a8283cf7050b9877affe Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sun, 21 Sep 2025 15:46:20 -0400 Subject: [PATCH 7/8] ci: fix conflicting names + original timeout --- .github/workflows/CommonCI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CommonCI.yml b/.github/workflows/CommonCI.yml index 6ff38ad933..125c7d4ceb 100644 --- a/.github/workflows/CommonCI.yml +++ b/.github/workflows/CommonCI.yml @@ -149,7 +149,7 @@ jobs: xla_runtime = "PJRT" - name: "Run Tests (PJRT)" if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }} - timeout-minutes: 60 + timeout-minutes: 120 run: | import Pkg Pkg.Registry.update() @@ -176,7 +176,7 @@ jobs: xla_runtime = "IFRT" - name: "Run Tests (IFRT)" if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }} - timeout-minutes: 60 + timeout-minutes: 120 run: | import Pkg Pkg.Registry.update() @@ -197,7 +197,7 @@ jobs: timeout-minutes: 10 if: ${{ always() }} with: - name: "mlir-${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}" + name: "mlir-${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}-test_group=${{ inputs.test_group }}-${{ inputs.localjll }}" path: "**/*.mlir" retention-days: 90 overwrite: false From c24ec97c3d1ee82a2579f05d67a56ddfa7c4dd9e Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 22 Sep 2025 13:18:12 -0400 Subject: [PATCH 8/8] ci: apply suggestions from code review --- .github/workflows/CommonCI.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CommonCI.yml b/.github/workflows/CommonCI.yml index 125c7d4ceb..5bb654bf5d 100644 --- a/.github/workflows/CommonCI.yml +++ b/.github/workflows/CommonCI.yml @@ -134,8 +134,6 @@ jobs: shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} # Only in Julia v1.10 we need to install `ReactantCore` manually. if: ${{ inputs.julia_version == '1.10' || inputs.julia_version == 'lts' }} - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager # Run the tests (pjrt or ifrt or both) - name: "Setup Runtime Preferences (PJRT)" @@ -160,10 +158,7 @@ jobs: shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} env: ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }} - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager REACTANT_TEST_GROUP: ${{ inputs.test_group }} - XLA_FLAGS: "--xla_force_host_platform_device_count=12" - JULIA_DEBUG: "Reactant,Reactant_jll" - name: "Setup Runtime Preferences (IFRT)" if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }} @@ -187,15 +182,12 @@ jobs: shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} env: ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }} - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager REACTANT_TEST_GROUP: ${{ inputs.test_group }} - XLA_FLAGS: "--xla_force_host_platform_device_count=12" - JULIA_DEBUG: "Reactant,Reactant_jll" - name: "Upload MLIR modules" uses: actions/upload-artifact@v4 timeout-minutes: 10 - if: ${{ always() }} + if: always() with: name: "mlir-${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}-test_group=${{ inputs.test_group }}-${{ inputs.localjll }}" path: "**/*.mlir" @@ -203,7 +195,7 @@ jobs: overwrite: false - name: Save Julia depot cache on cancel or failure - if: ${{ inputs.localjll && (cancelled() || failure()) }} + if: cancelled() || failure() uses: actions/cache/save@v4 with: path: | @@ -215,3 +207,8 @@ jobs: with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} + +env: + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + XLA_FLAGS: "--xla_force_host_platform_device_count=12" + JULIA_DEBUG: "Reactant,Reactant_jll"