Skip to content
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

force singlethreading during precompilation #48592

Merged

Conversation

IanButterworth
Copy link
Sponsor Member

Only allowing 1 julia thread during precompiling packages makes sense in the context that

  • Pkg.precompile manages multi-processing, and any multithreading during precompilation risks overloading the system
  • The upcoming LLVM image parallel PR Parallelize LLVM image generation #47797 has it's own JULIA_IMAGE_THREADS env var for controlling that multithreading, which Pkg.precompile will be taught to manage

And a niche issue:

A pkgeval run would probably be a good idea for this

@IanButterworth IanButterworth added the needs pkgeval Tests for all registered packages should be run with this change label Feb 8, 2023
@IanButterworth
Copy link
Sponsor Member Author

It seems the -t arg doesn't propagate through julia_cmd() so I've switched it over to JULIA_NUM_THREADS

$ ./julia -t2

julia> Base.julia_cmd()
`/home/ian/Documents/GitHub/julia/usr/bin/julia -Cnative -J/home/ian/Documents/GitHub/julia/usr/lib/julia/sys.so -g1`

@DilumAluthge
Copy link
Member

It seems the -t arg doesn't propagate through julia_cmd()

Is this a separate bug that we should fix?

@IanButterworth
Copy link
Sponsor Member Author

Discussed on slack and it seems logical that it doesn't. julia_cmd() only propagates declared args, not promising all are, and propagating -t to subprocesses doesn't seem to make sense.

@IanButterworth IanButterworth changed the title always precompile with only 1 thread force singlethreading during precompilation Feb 9, 2023
@IanButterworth
Copy link
Sponsor Member Author

@nanosoldier runtests()

@nanosoldier
Copy link
Collaborator

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

@IanButterworth IanButterworth removed the needs pkgeval Tests for all registered packages should be run with this change label Feb 10, 2023
@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Feb 10, 2023

pkgeval seems ok to me

@IanButterworth IanButterworth added the backport 1.9 Change should be backported to release-1.9 label Feb 10, 2023
@IanButterworth IanButterworth merged commit c0d2c57 into JuliaLang:master Feb 10, 2023
@IanButterworth IanButterworth deleted the ib/compilecache_1thread branch February 10, 2023 12:19
@@ -2070,7 +2070,8 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
--color=$(have_color === nothing ? "auto" : have_color ? "yes" : "no")
$trace
-`,
"OPENBLAS_NUM_THREADS" => 1),
"OPENBLAS_NUM_THREADS" => 1,
"JULIA_NUM_THREADS" => 1),
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                              "JULIA_NUM_THREADS" => nothing),

@KristofferC KristofferC mentioned this pull request Feb 20, 2023
50 tasks
KristofferC pushed a commit that referenced this pull request Feb 20, 2023
KristofferC pushed a commit that referenced this pull request Feb 20, 2023
KristofferC pushed a commit that referenced this pull request Feb 20, 2023
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Mar 6, 2023
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.

None yet

6 participants