Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,5 @@ concurrency:

jobs:
tests:
name: "Tests"
strategy:
fail-fast: false
matrix:
version:
- "1"
- "lts"
- "pre"
group:
- Core
- Enzyme
exclude:
- version: "pre"
group: Enzyme
uses: "SciML/.github/.github/workflows/tests.yml@v1"
with:
julia-version: "${{ matrix.version }}"
group: "${{ matrix.group }}"
uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1"
secrets: "inherit"
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ FastPowerTrackerExt = "Tracker"

[compat]
Enzyme = "0.13.89"
EnzymeTestUtils = "0.2"
ForwardDiff = "0.10, 1"
Measurements = "2.5"
MonteCarloMeasurements = "1"
Mooncake = "0.4, 0.5"
ReverseDiff = "1.14"
Test = "1"
Tracker = "0.2"
julia = "1.10"

Expand All @@ -38,9 +40,10 @@ Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
EnzymeTestUtils = "12d8515a-0907-448a-8884-5fe00fdf1c5a"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"

[targets]
test = ["Test", "Enzyme", "EnzymeTestUtils", "ForwardDiff", "Mooncake", "ReverseDiff", "Tracker"]
test = ["Test", "Enzyme", "EnzymeTestUtils", "ForwardDiff", "Mooncake", "Pkg", "ReverseDiff", "Tracker"]
15 changes: 15 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
FastPower = "a4df4552-cc26-4903-aec0-212e50a0e84b"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
FastPower = {path = "../.."}

[compat]
Aqua = "0.8"
JET = "0.9,0.10,0.11"
Test = "1"
julia = "1.10"
13 changes: 13 additions & 0 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using FastPower
using Aqua
using JET
using Test

@testset "Aqua" begin
Aqua.test_all(FastPower; deps_compat = (; check_extras = false))
@test_broken false # Aqua deps_compat (extras): Pkg has no [compat] entry — see https://github.com/SciML/FastPower.jl/issues/53
end

@testset "JET" begin
JET.test_package(FastPower; target_defined_modules = true)
end
20 changes: 14 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
using FastPower
using FastPower: fastlog2, fastpower
using Test
using ForwardDiff, ReverseDiff, Tracker, Mooncake
using Enzyme, EnzymeTestUtils

const GROUP = get(ENV, "GROUP", "All")

if GROUP == "QA"
using Pkg
Pkg.activate(joinpath(@__DIR__, "qa"))
Pkg.instantiate()
include(joinpath(@__DIR__, "qa", "qa.jl"))
end

if GROUP == "All" || GROUP == "Core" || GROUP == "Enzyme"
using FastPower
using FastPower: fastlog2, fastpower
end

if GROUP == "All" || GROUP == "Core"
@testset "Fast log2" begin
for x in 0.001:0.001:1.2 # (0, 1+something] is the domain which a controller uses
Expand All @@ -24,8 +36,6 @@ if GROUP == "All" || GROUP == "Core"
@test maximum(errors) < 1.0e-2
end

using ForwardDiff, ReverseDiff, Tracker, Mooncake

function mooncake_derivative(f, x)
return Mooncake.value_and_gradient!!(Mooncake.build_rrule(f, x), f, x)[2][2]
end
Expand All @@ -44,8 +54,6 @@ if GROUP == "All" || GROUP == "Core"
end

if GROUP == "All" || GROUP == "Enzyme"
using Enzyme, EnzymeTestUtils

@testset "Fast pow - Enzyme forward rule" begin
@testset for RT in (Duplicated, DuplicatedNoNeed),
Tx in (Const, Duplicated),
Expand Down
8 changes: 8 additions & 0 deletions test/test_groups.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Core]
versions = ["lts", "1", "pre"]

[Enzyme]
versions = ["lts", "1"]

[QA]
versions = ["lts", "1"]
Loading