From 20b3db9222194481d9d580505262ac5df34d5e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 9 Mar 2025 13:31:47 +0000 Subject: [PATCH 1/5] [CI] Use debug build for x86_64 macOS jobs --- .github/workflows/CI.yml | 30 ------------------------------ LocalPreferences.toml | 3 +++ test/LocalPreferences.toml | 3 +++ 3 files changed, 6 insertions(+), 30 deletions(-) create mode 100644 LocalPreferences.toml create mode 100644 test/LocalPreferences.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0d84430243..2dc766887a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,43 +41,13 @@ jobs: - '1.11' # - 'nightly' os: - - ubuntu-24.04 - # `ubuntu-22.04-arm` is considered more stable than `ubuntu-24.04-arm`: - # . - - ubuntu-22.04-arm - macOS-13 - - macOS-latest test_group: - core - neural_networks - integration assertions: - false - include: - - os: ubuntu-24.04 - version: '1.10' - assertions: true - test_group: core - - os: ubuntu-24.04 - version: '1.10' - assertions: true - test_group: neural_networks - - os: ubuntu-24.04 - version: '1.10' - assertions: true - test_group: integration - # - 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: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 diff --git a/LocalPreferences.toml b/LocalPreferences.toml new file mode 100644 index 0000000000..9fd3433be7 --- /dev/null +++ b/LocalPreferences.toml @@ -0,0 +1,3 @@ +[Reactant_jll] +gpu = "none" +mode = "dbg" diff --git a/test/LocalPreferences.toml b/test/LocalPreferences.toml new file mode 100644 index 0000000000..9fd3433be7 --- /dev/null +++ b/test/LocalPreferences.toml @@ -0,0 +1,3 @@ +[Reactant_jll] +gpu = "none" +mode = "dbg" From 022d88793538b065b711163a881547dd80c0ac46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 9 Mar 2025 15:21:47 +0000 Subject: [PATCH 2/5] Simplify reproducer? --- .github/workflows/CI.yml | 2 +- test/runtests.jl | 56 ++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2dc766887a..591d89f808 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -44,7 +44,7 @@ jobs: - macOS-13 test_group: - core - - neural_networks + # - neural_networks - integration assertions: - false diff --git a/test/runtests.jl b/test/runtests.jl index 979e6a461b..a751199e1e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -43,40 +43,40 @@ const REACTANT_TEST_GROUP = lowercase(get(ENV, "REACTANT_TEST_GROUP", "all")) @testset ExtendedTestSet "Reactant.jl Tests" begin if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "core" - @safetestset "Layout" include("layout.jl") - @safetestset "Tracing" include("tracing.jl") + # @safetestset "Layout" include("layout.jl") + # @safetestset "Tracing" include("tracing.jl") @safetestset "Basic" include("basic.jl") - @safetestset "Autodiff" include("autodiff.jl") - @safetestset "Complex" include("complex.jl") - @safetestset "Broadcast" include("bcast.jl") - @safetestset "Struct" include("struct.jl") - @safetestset "Closure" include("closure.jl") - @safetestset "Compile" include("compile.jl") - @safetestset "Buffer Donation" include("buffer_donation.jl") - @safetestset "Shortcuts to MLIR ops" include("ops.jl") - @safetestset "Wrapped Arrays" include("wrapped_arrays.jl") - @safetestset "Control Flow" include("control_flow.jl") - @safetestset "Sorting" include("sorting.jl") - @safetestset "Indexing" include("indexing.jl") - if !Sys.isapple() - @safetestset "Custom Number Types" include("custom_number_types.jl") - end - @safetestset "Sharding" include("sharding.jl") + # @safetestset "Autodiff" include("autodiff.jl") + # @safetestset "Complex" include("complex.jl") + # @safetestset "Broadcast" include("bcast.jl") + # @safetestset "Struct" include("struct.jl") + # @safetestset "Closure" include("closure.jl") + # @safetestset "Compile" include("compile.jl") + # @safetestset "Buffer Donation" include("buffer_donation.jl") + # @safetestset "Shortcuts to MLIR ops" include("ops.jl") + # @safetestset "Wrapped Arrays" include("wrapped_arrays.jl") + # @safetestset "Control Flow" include("control_flow.jl") + # @safetestset "Sorting" include("sorting.jl") + # @safetestset "Indexing" include("indexing.jl") + # if !Sys.isapple() + # @safetestset "Custom Number Types" include("custom_number_types.jl") + # end + # @safetestset "Sharding" include("sharding.jl") - @testset "IFRT" begin - @safetestset "IFRT Low-Level API" include("ifrt/low_level.jl") - end + # @testset "IFRT" begin + # @safetestset "IFRT Low-Level API" include("ifrt/low_level.jl") + # end end if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "integration" - @safetestset "CUDA" include("integration/cuda.jl") - @safetestset "KernelAbstractions" include("integration/kernelabstractions.jl") - @safetestset "Linear Algebra" include("integration/linear_algebra.jl") - @safetestset "OffsetArrays" include("integration/offsetarrays.jl") - @safetestset "AbstractFFTs" include("integration/fft.jl") + # @safetestset "CUDA" include("integration/cuda.jl") + # @safetestset "KernelAbstractions" include("integration/kernelabstractions.jl") + # @safetestset "Linear Algebra" include("integration/linear_algebra.jl") + # @safetestset "OffsetArrays" include("integration/offsetarrays.jl") + # @safetestset "AbstractFFTs" include("integration/fft.jl") @safetestset "SpecialFunctions" include("integration/special_functions.jl") - @safetestset "Random" include("integration/random.jl") - @safetestset "Python" include("integration/python.jl") + # @safetestset "Random" include("integration/random.jl") + # @safetestset "Python" include("integration/python.jl") end if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "neural_networks" From 68cabcf6fa1cdff48fd55abcf4c88d643ecf4663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 9 Mar 2025 15:27:58 +0000 Subject: [PATCH 3/5] Make tests pass for once to warm up precompile cache --- test/runtests.jl | 92 ++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index a751199e1e..69f54cf5c4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -41,52 +41,52 @@ end const REACTANT_TEST_GROUP = lowercase(get(ENV, "REACTANT_TEST_GROUP", "all")) -@testset ExtendedTestSet "Reactant.jl Tests" begin - if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "core" - # @safetestset "Layout" include("layout.jl") - # @safetestset "Tracing" include("tracing.jl") - @safetestset "Basic" include("basic.jl") - # @safetestset "Autodiff" include("autodiff.jl") - # @safetestset "Complex" include("complex.jl") - # @safetestset "Broadcast" include("bcast.jl") - # @safetestset "Struct" include("struct.jl") - # @safetestset "Closure" include("closure.jl") - # @safetestset "Compile" include("compile.jl") - # @safetestset "Buffer Donation" include("buffer_donation.jl") - # @safetestset "Shortcuts to MLIR ops" include("ops.jl") - # @safetestset "Wrapped Arrays" include("wrapped_arrays.jl") - # @safetestset "Control Flow" include("control_flow.jl") - # @safetestset "Sorting" include("sorting.jl") - # @safetestset "Indexing" include("indexing.jl") - # if !Sys.isapple() - # @safetestset "Custom Number Types" include("custom_number_types.jl") - # end - # @safetestset "Sharding" include("sharding.jl") +# @testset ExtendedTestSet "Reactant.jl Tests" begin +# if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "core" +# # @safetestset "Layout" include("layout.jl") +# # @safetestset "Tracing" include("tracing.jl") +# @safetestset "Basic" include("basic.jl") +# # @safetestset "Autodiff" include("autodiff.jl") +# # @safetestset "Complex" include("complex.jl") +# # @safetestset "Broadcast" include("bcast.jl") +# # @safetestset "Struct" include("struct.jl") +# # @safetestset "Closure" include("closure.jl") +# # @safetestset "Compile" include("compile.jl") +# # @safetestset "Buffer Donation" include("buffer_donation.jl") +# # @safetestset "Shortcuts to MLIR ops" include("ops.jl") +# # @safetestset "Wrapped Arrays" include("wrapped_arrays.jl") +# # @safetestset "Control Flow" include("control_flow.jl") +# # @safetestset "Sorting" include("sorting.jl") +# # @safetestset "Indexing" include("indexing.jl") +# # if !Sys.isapple() +# # @safetestset "Custom Number Types" include("custom_number_types.jl") +# # end +# # @safetestset "Sharding" include("sharding.jl") - # @testset "IFRT" begin - # @safetestset "IFRT Low-Level API" include("ifrt/low_level.jl") - # end - end +# # @testset "IFRT" begin +# # @safetestset "IFRT Low-Level API" include("ifrt/low_level.jl") +# # end +# end - if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "integration" - # @safetestset "CUDA" include("integration/cuda.jl") - # @safetestset "KernelAbstractions" include("integration/kernelabstractions.jl") - # @safetestset "Linear Algebra" include("integration/linear_algebra.jl") - # @safetestset "OffsetArrays" include("integration/offsetarrays.jl") - # @safetestset "AbstractFFTs" include("integration/fft.jl") - @safetestset "SpecialFunctions" include("integration/special_functions.jl") - # @safetestset "Random" include("integration/random.jl") - # @safetestset "Python" include("integration/python.jl") - end +# if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "integration" +# # @safetestset "CUDA" include("integration/cuda.jl") +# # @safetestset "KernelAbstractions" include("integration/kernelabstractions.jl") +# # @safetestset "Linear Algebra" include("integration/linear_algebra.jl") +# # @safetestset "OffsetArrays" include("integration/offsetarrays.jl") +# # @safetestset "AbstractFFTs" include("integration/fft.jl") +# @safetestset "SpecialFunctions" include("integration/special_functions.jl") +# # @safetestset "Random" include("integration/random.jl") +# # @safetestset "Python" include("integration/python.jl") +# end - if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "neural_networks" - @testset "Neural Networks" begin - @safetestset "NNlib Primitives" include("nn/nnlib.jl") - @safetestset "Flux.jl Integration" include("nn/flux.jl") - if Sys.islinux() - @safetestset "LuxLib Primitives" include("nn/luxlib.jl") - @safetestset "Lux Integration" include("nn/lux.jl") - end - end - end -end +# if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "neural_networks" +# @testset "Neural Networks" begin +# @safetestset "NNlib Primitives" include("nn/nnlib.jl") +# @safetestset "Flux.jl Integration" include("nn/flux.jl") +# if Sys.islinux() +# @safetestset "LuxLib Primitives" include("nn/luxlib.jl") +# @safetestset "Lux Integration" include("nn/lux.jl") +# end +# end +# end +# end From cea04131366a7c486d1d3ff74a19266e57157695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 9 Mar 2025 15:55:45 +0000 Subject: [PATCH 4/5] Revert "Make tests pass for once to warm up precompile cache" This reverts commit 68cabcf6fa1cdff48fd55abcf4c88d643ecf4663. --- test/runtests.jl | 92 ++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 69f54cf5c4..a751199e1e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -41,52 +41,52 @@ end const REACTANT_TEST_GROUP = lowercase(get(ENV, "REACTANT_TEST_GROUP", "all")) -# @testset ExtendedTestSet "Reactant.jl Tests" begin -# if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "core" -# # @safetestset "Layout" include("layout.jl") -# # @safetestset "Tracing" include("tracing.jl") -# @safetestset "Basic" include("basic.jl") -# # @safetestset "Autodiff" include("autodiff.jl") -# # @safetestset "Complex" include("complex.jl") -# # @safetestset "Broadcast" include("bcast.jl") -# # @safetestset "Struct" include("struct.jl") -# # @safetestset "Closure" include("closure.jl") -# # @safetestset "Compile" include("compile.jl") -# # @safetestset "Buffer Donation" include("buffer_donation.jl") -# # @safetestset "Shortcuts to MLIR ops" include("ops.jl") -# # @safetestset "Wrapped Arrays" include("wrapped_arrays.jl") -# # @safetestset "Control Flow" include("control_flow.jl") -# # @safetestset "Sorting" include("sorting.jl") -# # @safetestset "Indexing" include("indexing.jl") -# # if !Sys.isapple() -# # @safetestset "Custom Number Types" include("custom_number_types.jl") -# # end -# # @safetestset "Sharding" include("sharding.jl") +@testset ExtendedTestSet "Reactant.jl Tests" begin + if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "core" + # @safetestset "Layout" include("layout.jl") + # @safetestset "Tracing" include("tracing.jl") + @safetestset "Basic" include("basic.jl") + # @safetestset "Autodiff" include("autodiff.jl") + # @safetestset "Complex" include("complex.jl") + # @safetestset "Broadcast" include("bcast.jl") + # @safetestset "Struct" include("struct.jl") + # @safetestset "Closure" include("closure.jl") + # @safetestset "Compile" include("compile.jl") + # @safetestset "Buffer Donation" include("buffer_donation.jl") + # @safetestset "Shortcuts to MLIR ops" include("ops.jl") + # @safetestset "Wrapped Arrays" include("wrapped_arrays.jl") + # @safetestset "Control Flow" include("control_flow.jl") + # @safetestset "Sorting" include("sorting.jl") + # @safetestset "Indexing" include("indexing.jl") + # if !Sys.isapple() + # @safetestset "Custom Number Types" include("custom_number_types.jl") + # end + # @safetestset "Sharding" include("sharding.jl") -# # @testset "IFRT" begin -# # @safetestset "IFRT Low-Level API" include("ifrt/low_level.jl") -# # end -# end + # @testset "IFRT" begin + # @safetestset "IFRT Low-Level API" include("ifrt/low_level.jl") + # end + end -# if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "integration" -# # @safetestset "CUDA" include("integration/cuda.jl") -# # @safetestset "KernelAbstractions" include("integration/kernelabstractions.jl") -# # @safetestset "Linear Algebra" include("integration/linear_algebra.jl") -# # @safetestset "OffsetArrays" include("integration/offsetarrays.jl") -# # @safetestset "AbstractFFTs" include("integration/fft.jl") -# @safetestset "SpecialFunctions" include("integration/special_functions.jl") -# # @safetestset "Random" include("integration/random.jl") -# # @safetestset "Python" include("integration/python.jl") -# end + if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "integration" + # @safetestset "CUDA" include("integration/cuda.jl") + # @safetestset "KernelAbstractions" include("integration/kernelabstractions.jl") + # @safetestset "Linear Algebra" include("integration/linear_algebra.jl") + # @safetestset "OffsetArrays" include("integration/offsetarrays.jl") + # @safetestset "AbstractFFTs" include("integration/fft.jl") + @safetestset "SpecialFunctions" include("integration/special_functions.jl") + # @safetestset "Random" include("integration/random.jl") + # @safetestset "Python" include("integration/python.jl") + end -# if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "neural_networks" -# @testset "Neural Networks" begin -# @safetestset "NNlib Primitives" include("nn/nnlib.jl") -# @safetestset "Flux.jl Integration" include("nn/flux.jl") -# if Sys.islinux() -# @safetestset "LuxLib Primitives" include("nn/luxlib.jl") -# @safetestset "Lux Integration" include("nn/lux.jl") -# end -# end -# end -# end + if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "neural_networks" + @testset "Neural Networks" begin + @safetestset "NNlib Primitives" include("nn/nnlib.jl") + @safetestset "Flux.jl Integration" include("nn/flux.jl") + if Sys.islinux() + @safetestset "LuxLib Primitives" include("nn/luxlib.jl") + @safetestset "Lux Integration" include("nn/lux.jl") + end + end + end +end From b6340b5449e3c6cc9cb7f79e8517b40c19e86217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 9 Mar 2025 15:57:27 +0000 Subject: [PATCH 5/5] Tmate time --- .github/workflows/CI.yml | 27 +++++++++------------------ test/Project.toml | 8 ++++++-- test/integration/special_functions.jl | 1 + 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 591d89f808..14ca2d2754 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,20 +30,20 @@ concurrency: jobs: test: - timeout-minutes: 90 + # timeout-minutes: 90 name: Julia ${{ matrix.version }} - ${{ matrix.test_group }} - ${{ matrix.os }} - assertions=${{ matrix.assertions }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: - - '1.10' + # - '1.10' - '1.11' # - 'nightly' os: - macOS-13 test_group: - - core + # - core # - neural_networks - integration assertions: @@ -82,19 +82,10 @@ jobs: 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 - REACTANT_TEST_GROUP: ${{ matrix.test_group }} - XLA_FLAGS: "--xla_force_host_platform_device_count=8" - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v5 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 with: - files: lcov.info + limit-access-to-actor: false + # Debug with: + # julia --color=yes --code-coverage=user --depwarn=yes --check-bounds=yes --warn-overwrite=yes --inline=yes --startup-file=no --project=test -e 'using Pkg; Pkg.instantiate()' + # lldb -- julia --color=yes --code-coverage=user --depwarn=yes --check-bounds=yes --warn-overwrite=yes --inline=yes --startup-file=no --project=test test/integration/special_functions.jl diff --git a/test/Project.toml b/test/Project.toml index c66d9cdb22..9746ec794f 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -22,6 +22,9 @@ Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2" PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Random123 = "74087812-796a-5b5d-8853-05524746bad3" +Reactant = "3c362404-f566-11ee-1572-e11a4b42c853" +ReactantCore = "a3311ec8-5e00-46d5-b541-4f83e724a433" +Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" @@ -62,5 +65,6 @@ StatsBase = "0.34" Test = "1.10" TestSetExtensions = "3" -[extras] -Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0" +[sources] +ReactantCore = {path = "../lib/ReactantCore"} +Reactant = {path = ".."} diff --git a/test/integration/special_functions.jl b/test/integration/special_functions.jl index c63f80b48d..3c9a0849ab 100644 --- a/test/integration/special_functions.jl +++ b/test/integration/special_functions.jl @@ -1,3 +1,4 @@ +using Test using SpecialFunctions, Reactant macro ≈(a, b)