Skip to content

Conversation

@giordano
Copy link
Collaborator

I'm happy to discuss alternative solutions, I'm not married to this one in particular, but the problem I want to solve is to be able to spawn more jobs than what default_njobs would do. Setting JULIA_CPU_THREADS only affects

jobs = cpu_threads
memory_jobs = Int64(free_memory) ÷ (2 * 2^30)
return max(1, min(jobs, memory_jobs))
but that doesn't help anything, because the limitation is usually memory_jobs. Perhaps an alternative solution is to be able to control the expected memory usage more easily, which at the moment is impossible.

The only thing I like of using an environment variable to override the number of jobs is that that's easy to set in CI jobs, my main use case would be to have at least 2 parallel jobs on Apple Silicon macOS on GitHub-hosted runners, because at the moment we always get only one (3 CPUs and 7 GB of memory), which is a waste for most jobs.

@giordano
Copy link
Collaborator Author

Motivation for this PR was to be able to affect number of jobs without having to replace the julia-actions/julia-runtest workflow with a custom shell command call, but that may be possible with https://github.com/julia-actions/julia-runtest/blob/a3f37496e4b615530efe32573ddfa6c19712f5e7/README.md#pass-arguments-to-test-suite, I need to explore that.

@giordano giordano marked this pull request as draft October 25, 2025 11:20
@giordano
Copy link
Collaborator Author

Ok, setting the test_args option to julia-actions/julia-runtest works well, and I got some solid speedup in Enzyme tests: EnzymeAD/Enzyme.jl#2690 (review).

I'm going to close this PR, although the point about more flexible memory requirements for the tests still stands.

@giordano giordano closed this Oct 25, 2025
@giordano giordano deleted the mg/env-var-num-jobs branch October 25, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant