Skip to content

Commit

Permalink
python312Packages.numpyro: reduce number of pytest parallel workers t…
Browse files Browse the repository at this point in the history
…o reduce RAM usage
  • Loading branch information
GaetanLepage committed Jan 8, 2025
1 parent 6d88f20 commit 25d3852
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/development/python-modules/numpyro/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ buildPythonPackage rec {

pythonImportsCheck = [ "numpyro" ];

# Required to override `--numprocesses` in `pytestFlagsArray`
dontUsePytestXdist = true;
pytestFlagsArray = [
# Tests memory consumption grows significantly with the number of parallel processes (reaches ~200GB with 80 jobs)
"--numprocesses=$((NIX_BUILD_CORES > 8 ? 8 : NIX_BUILD_CORES))"

# A few tests fail with:
# UserWarning: There are not enough devices to run parallel chains: expected 2 but got 1.
# Chains will be drawn sequentially. If you are running MCMC in CPU, consider using `numpyro.set_host_device_count(2)` at the beginning of your program.
Expand Down

0 comments on commit 25d3852

Please sign in to comment.