NVIDIA / JAX-Toolbox

JAX-Toolbox
Apache License 2.0
239 stars 45 forks source link

JAX unit test concurrency should be set by CPU count, not GPU count #228

Open yhtang opened 1 year ago

yhtang commented 1 year ago

Pending confirmation from other developers, it seems that the //tests:gpu_tests tests are (counterintuitive) bottlenecked by CPU concurrency and performance. Hence, the best performance for JAX unit testing may be achieved by adjusting the Bazel job count according to number of CPU cores available, rather than the number of GPUs available.

nouiz commented 1 year ago

It is more complicated then this. Using the CPU cores will cause too many contexts and slowdown tests and crashes others. We need to parallelize per GPUs, but we can overload a little bit each GPU if there is enough GPU memory. Like 2 or 4 tests per GPUs. Also, the more GPUs are in the box, the less jobs per GPUs we can run, as there are limitation in the driver. Newer driver allow more context in total to be created.

So mostly, we need a mix of both.