Skip to content

Fix n_jobs's default and make it work for more APIs #2387

Open
1 of 1 issue completed
Open

Description

@alexlenail

scanpy docs:

n_jobs : Optional[int] (default: None)
Number of threads to use in training. All cores are used by default.

magic docs:

n_jobs (integer, optional, default: 1) – The number of jobs to use for the computation. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging.

scanpy code:

n_jobs = settings.n_jobs if n_jobs is None else n_jobs

n_jobs=1,

I'm guessing the scanpy docs are wrong when they say "All cores are used by default." ?

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. jpmcga commented on Mar 11, 2025

    @jpmcga

    ^^I've empirically confirmed this; been seeing multi-fold speedups when I set n_jobs=-1 corresponding to the number of cores, versus running with the default. From what I can tell, running without specifying n_jobs results in 1 core being used.

  2. modified the milestones: 1.12.0, 1.11.1 on Mar 11, 2025
  3. flying-sheep commented on Mar 11, 2025

    @flying-sheep
    Member

    Yeah, we definitely need to improve this. #2390 is also relevant here

  4. modified the milestones: 1.11.1, 1.11.2 on Mar 31, 2025
  5. modified the milestones: 1.11.2, 1.11.3 on May 28, 2025
  6. modified the milestones: 1.11.3, 1.11.4 on Jul 1, 2025
  7. modified the milestones: 1.11.4, 1.11.6 on Oct 21, 2025
  8. modified the milestones: 1.11.6, 1.12.0 on Nov 10, 2025
  9. modified the milestones: 1.12.0, 1.13.0 on Jan 23, 2026
  10. changed the title [-]`sc.external.pp.magic`: what is `n_jobs`'s default _really_?[/-] [+]Fix `n_jobs`'s default and make it work for more APIs[/+] on Apr 27, 2026
  11. modified the milestones: 1.13.0, 1.14.0 on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions