-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
A start at "extensive" tests that run up to # Run one or more exhaustive test
LIBM_EXTENSIVE_TESTS=sinf,cosf cargo t --features test-multiprecision --release -- extensive
# Run all `f32` or `f64` tests
LIBM_EXTENSIVE_TESTS=all_f32 cargo t --features test-multiprecision --release -- extensive
# Run everything
LIBM_EXTENSIVE_TESTS=all cargo t --features test-multiprecision --release -- extensive For single-arg I ran a handful of tests on my 24-core machine, the current setup with Rayon ranges about 10m-1h depending on the test. That can probably be improved, I haven't looked at this from a perf perspective at all (though one thing I noticed quickly from htop is there is a lot of time spent in kthreads, maybe I need to double check if Rayon is doing batching). After I get this a bit better sorted out, I am going to hook up CI to run relevant tests when source files change. Current state is very scratchy. @beetrees you may be interested since I know you suggested this a few times. |
I'm using the mimic harness so I can skip tests at runtime and show a progress bar, sample output.
|
Way faster with chunking, |
ee66993
to
6da3286
Compare
0b9a08c
to
8ece7f7
Compare
a04c94e
to
d983a94
Compare
200a876
to
dca3fae
Compare
2b59b84
to
06e329c
Compare
dca3fae
to
5a2e027
Compare
One last thing I need to do here is figure out how to reduce the scope for jnf / ynf, on my machine MPFR hits |
5a2e027
to
0be0b07
Compare
0be0b07
to
b02ca43
Compare
Add a generator that will test all inputs for input spaces `u32::MAX` or smaller (e.g. single-argument `f32` routines). For anything larger, still run approximately `u32::MAX` tests, but distribute inputs evenly across the function domain. Since we often only want to run one of these tests at a time, this implementation parallelizes within each test using `rayon`. A custom test runner is used so a progress bar is possible. Specific tests must be enabled by setting the `LIBM_EXTENSIVE_TESTS` environment variable, e.g. LIBM_EXTENSIVE_TESTS=all_f16,cos,cosf cargo run ... Testing on a recent machine, most tests take about two minutes or less. The Bessel functions are quite slow and take closer to 10 minutes, and FMA is increased to run for about the same.
Update the script to produce, in addition to the simple text list, a JSON file listing routine names, the types they work with, and the source files that contain a function with the routine name. This gets consumed by another script and will be used to determine which extensive CI jobs to run.
Add a CI job with a dynamically calculated matrix that runs extensive jobs on changed files. This makes use of the new `function-definitions.json` file to determine which changed files require full tests for a routine to run.
I wanted to move this to a rust-lang branch so I can point other PRs at it. Reopened as #388. |
Add a generator that will test all inputs for input spaces
u32::MAX
or smaller (e.g. single-argumentf32
routines). For anything larger, still run approximatelyu32::MAX
tests, but distribute inputs evenly across the function domain.Since we often only want to run one of these tests at a time, this implementation parallelizes within each test using
rayon
. A custom test runner is used so a progress bar is possible.Specific tests must be enabled by setting the
LIBM_EXTENSIVE_TESTS
environment variable, e.g.Testing on a recent machine, most tests take about two minutes or less. The Bessel functions are quite slow and take closer to 10 minutes, and FMA is increased to run for about the same.