diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index da495adc60..8b13789179 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,79 +1 @@ -steps: - - label: "CUDA Julia v{{matrix.version}}" - matrix: - setup: - version: - - "1.10" - - "1.11" - - "1.12" - plugins: - - JuliaCI/julia#v1: - version: "{{matrix.version}}" - agents: - queue: "cuda" - if: build.message !~ /\[skip tests\]/ - timeout_in_minutes: 60 - commands: | - echo "--- Setup Julia packages" - JULIA_PKG_PRECOMPILE_AUTO="false" julia --color=yes -e ' - using Pkg - pkgs = [PackageSpec(; path) for path in (".", "lib/EnzymeCore", "lib/EnzymeTestUtils")] - Pkg.develop(pkgs) - Pkg.add(PackageSpec(; name="CUDA", version="6"))' || exit 3 - echo "+++ Run tests" - julia --color=yes test/cuda.jl - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - -# - label: "AMDGPU Julia v{{matrix.version}}" -# matrix: -# setup: -# version: -# - "1.10" -# plugins: -# - JuliaCI/julia#v1: -# version: "{{matrix.version}}" -# agents: -# queue: "rocm" -# if: build.message !~ /\[skip tests\]/ -# timeout_in_minutes: 60 -# commands: | -# echo "--- Setup Julia packages" -# julia --color=yes -e ' -# using Pkg -# pkgs = [PackageSpec(; path) for path in (".", "lib/EnzymeCore", "lib/EnzymeTestUtils")] -# push!(pkgs, PackageSpec(; name="AMDGPU")) -# Pkg.develop(pkgs)' || exit 3 -# -# echo "+++ Run tests" -# julia --color=yes test/amdgpu.jl -# env: -# JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager -# - - label: "Metal Julia v{{matrix.version}}" - matrix: - setup: - version: - - "1.10" - - "1.11" - - "1.12" - plugins: - - JuliaCI/julia#v1: - version: "{{matrix.version}}" - agents: - queue: "metal" - if: build.message !~ /\[skip tests\]/ - timeout_in_minutes: 60 - commands: | - echo "--- Setup Julia packages" - julia --color=yes -e ' - using Pkg - pkgs = [PackageSpec(; path) for path in (".", "lib/EnzymeCore", "lib/EnzymeTestUtils")] - push!(pkgs, PackageSpec(; name="Metal")) - Pkg.develop(pkgs)' || exit 3 - - echo "+++ Run tests" - julia --color=yes test/metal.jl - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b3e095e483..ccd594f8cf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -45,8 +45,6 @@ jobs: - '1.12' - 'nightly' os: - - ubuntu-24.04 - - macOS-latest - windows-latest llvm_args: - '' @@ -59,44 +57,6 @@ jobs: - os: windows-latest arch: default libEnzyme: local - include: - - os: ubuntu-24.04 - arch: x86 - libEnzyme: packaged - version: '1.10' - assertions: false - - os: ubuntu-24.04 - arch: default - libEnzyme: packaged - version: '1.10' - assertions: true - - os: ubuntu-24.04 - arch: default - libEnzyme: packaged - version: '1.11' - assertions: true - - os: ubuntu-24.04 - arch: default - libEnzyme: packaged - version: '1.12' - assertions: true - - os: ubuntu-24.04 - arch: default - libEnzyme: packaged - version: '1.13' - assertions: true - - os: ubuntu-24.04 - arch: default - libEnzyme: packaged - version: '1.10' - assertions: true - llvm_args: '--opaque-pointers' - - os: ubuntu-24.04 - arch: default - libEnzyme: packaged - version: '1.11' - assertions: false - llvm_args: '--opaque-pointers' steps: - uses: actions/checkout@v7 - uses: julia-actions/setup-julia@v3 @@ -177,115 +137,3 @@ jobs: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false # or true if you want CI to fail when Codecov fails - - enzymetestutils: - timeout-minutes: 60 - name: EnzymeTestUtils - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.libEnzyme }} libEnzyme - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.version == 'nightly' }} - env: - JULIA_PROJECT: "lib/EnzymeTestUtils" - strategy: - fail-fast: false - matrix: - version: - - '1.10' - - '1.11' - - '1.12' - - 'nightly' - os: - - ubuntu-latest - arch: - - default - libEnzyme: [packaged] - steps: - - uses: actions/checkout@v7 - - uses: julia-actions/setup-julia@v3 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v3 - - name: setup EnzymeTestUtils - shell: julia --color=yes {0} - id: setup_testutils - continue-on-error: ${{ matrix.version == 'nightly' }} - run: | - using Pkg - Pkg.develop([PackageSpec(; path) for path in (".", "lib/EnzymeCore")]) - Pkg.instantiate() - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - - name: Run the tests - if: matrix.version != 'nightly' || steps.setup_testutils.outcome == 'success' - continue-on-error: ${{ matrix.version == 'nightly' }} - id: run_tests - shell: julia --color=yes {0} - run: | - using Pkg - Pkg.test("EnzymeTestUtils"; coverage=true) - - uses: julia-actions/julia-processcoverage@v1 - if: matrix.version != 'nightly' || steps.run_tests.outcome == 'success' - with: - directories: lib/EnzymeTestUtils/src - - uses: codecov/codecov-action@v7 - if: matrix.version != 'nightly' || steps.run_tests.outcome == 'success' - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false # or true if you want CI to fail when Codecov fails - - enzymecore: - timeout-minutes: 20 - name: EnzymeCore - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.libEnzyme }} libEnzyme - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.version == 'nightly' }} - env: - JULIA_PROJECT: "lib/EnzymeCore" - strategy: - fail-fast: false - matrix: - version: - - '1.10' - - '1.11' - - '1.12' - - 'nightly' - os: - - ubuntu-latest - arch: - - default - libEnzyme: [packaged] - steps: - - uses: actions/checkout@v7 - - uses: julia-actions/setup-julia@v3 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v3 - - name: setup EnzymeCore - shell: julia --color=yes {0} - id: setup_testutils - continue-on-error: ${{ matrix.version == 'nightly' }} - run: | - using Pkg - Pkg.develop([PackageSpec(; path) for path in (".",)]) - Pkg.instantiate() - env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager - - name: Run the tests - if: matrix.version != 'nightly' || steps.setup_testutils.outcome == 'success' - continue-on-error: ${{ matrix.version == 'nightly' }} - id: run_tests - shell: julia --color=yes {0} - run: | - using Pkg - Pkg.test("EnzymeCore"; coverage=true) - - uses: julia-actions/julia-processcoverage@v1 - if: matrix.version != 'nightly' || steps.run_tests.outcome == 'success' - with: - directories: lib/EnzymeCore/src - - uses: codecov/codecov-action@v7 - if: matrix.version != 'nightly' || steps.run_tests.outcome == 'success' - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false # or true if you want CI to fail when Codecov fails diff --git a/src/compiler/validation.jl b/src/compiler/validation.jl index feff0237a9..8ef9914a14 100644 --- a/src/compiler/validation.jl +++ b/src/compiler/validation.jl @@ -155,6 +155,7 @@ function restore_lookups(mod::LLVM.Module)::Nothing if isa(fattr, LLVM.StringAttribute) if kind(fattr) == "enzymejl_needs_restoration" v = parse(UInt, LLVM.value(fattr)) + Core.println("replaced (1)", string(f), " with ", v) replace_uses!( f, LLVM.Value( @@ -192,6 +193,7 @@ function restore_lookups(mod::LLVM.Module)::Nothing ) eraseInst(mod, f) else + Core.println("replaced (2)", string(f), " with ", v) replace_uses!( f, LLVM.Value( diff --git a/test/runtests.jl b/test/runtests.jl index 31dcf8b65b..10920de6b7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,42 +1,18 @@ -import Enzyme -import Enzyme_jll -using ParallelTestRunner: addworker, filter_tests!, find_tests, parse_args, runtests +using Enzyme +using Test -# Start with autodiscovered tests -testsuite = find_tests(@__DIR__) -# Add threads tests to be run with multiple Julia threads (will be configured in -# `test_worker`). -testsuite["threads/2"] = :(include($(joinpath(@__DIR__, "threads.jl")))) -# Exclude integration tests, they're handled differently (they each run in their -# own environment) -for (k, _) in testsuite - startswith(k, "integration/") && delete!(testsuite, k) -end - -# Parse arguments -args = parse_args(ARGS) - -if filter_tests!(testsuite, args) - # Skip GPU-specific tests by default. - delete!(testsuite, "metal") - delete!(testsuite, "cuda") - delete!(testsuite, "amdgpu") - delete!(testsuite, "common") +Enzyme.API.printall!(true) +Enzyme.Compiler.DumpPostOpt[] = true - # Skipped until https://github.com/EnzymeAD/Enzyme.jl/issues/2620 is fixed. - if Sys.iswindows() - delete!(testsuite, "ext/specialfunctions") - end -end +@testset "BigFloat arithmetic" begin + a = BigFloat(1.234) + da = BigFloat(-0.23) + b = BigFloat(0.56) + db = BigFloat(0.27) + af64 = 1.234 # for testing mixed methods + daf64 = -0.23 # for testing mixed methods + bf64 = 0.56 # for testing mixed methods + dbf64 = 0.27 # for testing mixed methods -function test_worker(name) - if name == "threads/2" - # Run the `threads/2` testset, with multiple threads. - return addworker(; exeflags = ["--threads=2"]) - end + @test autodiff(Enzyme.Forward, +, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da+db end - -const init_code = quote end - -@info "Testing against" Enzyme_jll.libEnzyme -runtests(Enzyme, args; testsuite, init_code, test_worker)