-
Notifications
You must be signed in to change notification settings - Fork 271
Fix n_jobs=-1 oversubscribing cores under CPU affinity restrictions
#4724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lochhh
wants to merge
6
commits into
SpikeInterface:main
Choose a base branch
from
lochhh:cpu-count
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2d6de3c
Add `get_usable_cpu_count`
lochhh 905e560
Update tests to use `get_usable_cpu_count`
lochhh 35e6897
Use `get_usable_cpu_count` in train.py and spyking_circus.py
lochhh 2bb477d
Remove redundant `fixed_job_kwargs` assignments
lochhh 4d8e79d
Use `reset_global_job_kwargs` to restore `global_job_kwargs`
lochhh 6907d17
Swap deepinterpolation CI deps installation order
lochhh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to test this function out on as many real life systems as possible to try and find any edge cases. I've tested on mac, local linux desktop Edinburgh supercomputer.
@lochhh have you tested this on the HPC?
@zm711 could you quickly test on windows?
@alejoe91 could you check in your set up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested 4 cpus on HPC:
srun --cpus-per-task=4 --pty bash -iThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also just want to make it clear in general that even working locally on a Windows 10/11 station setting n_jobs to be 7 (for 8 cores) would lead to all 8 cores being used at various stages because:
n_jobs =/= n_cores.That being said I have no problem with the logic for
-1being changed to not lead to too many processes for the number of cores (ie trying to keep the semantic that -1 = n_cpus available). But I just want us to remember not to overpromise whatn_jobsis actually setting.