Skip to content

Commit

Permalink
ci: parallel CPU testing
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Aug 24, 2024
1 parent c9559b8 commit b001128
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/layer_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
@jet model(x, ps, st)

__f = (x, ps) -> sum(abs2, first(model(x, ps, st)))
test_gradients(__f, x, ps; atol=1e-3, rtol=1e-3)
test_gradients(
__f, x, ps; atol=1e-3, rtol=1e-3, soft_fail=[AutoFiniteDiff()])
end
end
end
Expand Down
10 changes: 7 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ end
using Boltz

const BOLTZ_TEST_GROUP = get(ENV, "BOLTZ_TEST_GROUP", "all")
const RETESTITEMS_NWORKERS = parse(
Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 16))))
const RETESTITEMS_NWORKER_THREADS = parse(Int,
get(ENV, "RETESTITEMS_NWORKER_THREADS", string(max(Hwloc.num_virtual_cores(), 1))))
get(ENV, "RETESTITEMS_NWORKER_THREADS",
string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1))))

@info "Running tests for group: $BOLTZ_TEST_GROUP"
@info "Running tests for group: $BOLTZ_TEST_GROUP with $RETESTITEMS_NWORKERS workers"

ReTestItems.runtests(
Boltz; tags=(BOLTZ_TEST_GROUP == "all" ? nothing : [Symbol(BOLTZ_TEST_GROUP)]),
nworkers=0, nworker_threads=RETESTITEMS_NWORKER_THREADS, testitem_timeout=3600)
nworkers=ifelse(BACKEND_GROUP ("cuda", "amdgpu"), 0, RETESTITEMS_NWORKERS),
nworker_threads=RETESTITEMS_NWORKER_THREADS, testitem_timeout=3600)

2 comments on commit b001128

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/113766

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.12 -m "<description of version>" b001128f0093205507361643c07d629532fcb0d8
git push origin v0.3.12

Please sign in to comment.