Closed DatName closed 1 year ago
Thanks for opening an issue. Can you share the output of lscpu --all --extended
?
Sure
:~ $ lscpu --all --extended
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ MHZ
0 0 0 0 0:0:0:0 yes 5000.0000 400.0000 2900.000
1 0 0 0 0:0:0:0 yes 5000.0000 400.0000 2900.000
2 0 0 1 4:4:1:0 yes 5000.0000 400.0000 2900.000
3 0 0 1 4:4:1:0 yes 5000.0000 400.0000 2900.000
4 0 0 2 8:8:2:0 yes 5000.0000 400.0000 2900.000
5 0 0 2 8:8:2:0 yes 5000.0000 400.0000 2900.000
6 0 0 3 12:12:3:0 yes 5000.0000 400.0000 2900.000
7 0 0 3 12:12:3:0 yes 5000.0000 400.0000 2900.000
8 0 0 4 16:16:4:0 yes 5000.0000 400.0000 2900.000
9 0 0 4 16:16:4:0 yes 5000.0000 400.0000 2900.000
10 0 0 5 20:20:5:0 yes 5000.0000 400.0000 495.484
11 0 0 5 20:20:5:0 yes 5000.0000 400.0000 2900.000
12 0 0 6 24:24:6:0 yes 3800.0000 400.0000 2900.000
13 0 0 7 25:25:6:0 yes 3800.0000 400.0000 2900.000
14 0 0 8 26:26:6:0 yes 3800.0000 400.0000 2900.000
15 0 0 9 27:27:6:0 yes 3800.0000 400.0000 2900.000
16 0 0 10 28:28:7:0 yes 3800.0000 400.0000 2900.000
17 0 0 11 29:29:7:0 yes 3800.0000 400.0000 2900.000
18 0 0 12 30:30:7:0 yes 3800.0000 400.0000 2900.000
19 0 0 13 31:31:7:0 yes 3800.0000 400.0000 2900.000
First of all, interesting CPU. (I've not fully arrived in the world of "efficiency" and "performance" cores yet π)
In my rewrite for 0.6.0 I forgot to handle the case where the number of Julia threads is larger than the number of available cpu ids for a given pinning scheme. That is what hit you here because you have JULIA_NUM_THREADS=20
but only 14 cores (which is the places
default for :compact
pinning). I've fixed it on the main
branch and have included your lscpu
output into the test suite as well.
@DatName, it would be great if you could ] add ThreadPinning#main
and test if things are working. If so, I'll tag a new patch release soon after.
(BTW, the reason that this error appears already when precompiling is because we now use SnoopPrecompile to trigger some commands at precompile time to reduce runtime later.)
Here it is:
() pkg> add ThreadPinning#main
Cloning git-repo `https://github.com/carstenbauer/ThreadPinning.jl.git`
Updating git-repo `https://github.com/carstenbauer/ThreadPinning.jl.git`
Updating registry at `~/.julia/registries/KRWRegistry`
Updating git-repo `git@gitlab-kr:bender-ops/krwregistry.git`
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
Updating `~/Project.toml`
[811555cd] + ThreadPinning v0.6.0 `https://github.com/carstenbauer/ThreadPinning.jl.git#main`
Updating `~/Manifest.toml`
[21216c6a] + Preferences v1.3.0
[66db9d55] + SnoopPrecompile v1.0.1
[811555cd] + ThreadPinning v0.6.0 `https://github.com/carstenbauer/ThreadPinning.jl.git#main`
[56f22d72] + Artifacts
[ade2ca70] + Dates
[8bb1440f] + DelimitedFiles
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[a63ad114] + Mmap
[de0858da] + Printf
[9a3f8284] + Random
[ea8e919c] + SHA v0.7.0
[9e88b42a] + Serialization
[fa267f1f] + TOML v1.0.0
[4ec0a83e] + Unicode
[e66e0078] + CompilerSupportLibraries_jll v0.5.2+0
[4536629a] + OpenBLAS_jll v0.3.20+0
[8e850b90] + libblastrampoline_jll v5.1.1+0
Precompiling project...
β ThreadPinning
0 dependencies successfully precompiled in 2 seconds. 5 already precompiled.
1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
julia> using ThreadPinning
[ Info: Precompiling ThreadPinning [811555cd-349b-4f26-b7bc-1f208b848042]
ERROR: LoadError: ArgumentError: Only same length inputs supported.
Stacktrace:
[1] interweave(::Vector{Int64}, ::Vararg{Vector{Int64}})
@ ThreadPinning ~/.julia/packages/ThreadPinning/HVVtE/src/utility.jl:52
[2] getplaces_cpuids
@ ~/.julia/packages/ThreadPinning/HVVtE/src/pinning.jl:78 [inlined]
[3] getcpuids_pinning(::ThreadPinning.RandomBind, places::ThreadPinning.CPUThreads; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ThreadPinning ~/.julia/packages/ThreadPinning/HVVtE/src/pinning.jl:124
[4] getcpuids_pinning
@ ~/.julia/packages/ThreadPinning/HVVtE/src/pinning.jl:123 [inlined]
[5] pinthreads(pinning::ThreadPinning.RandomBind; places::ThreadPinning.CPUThreads, nthreads::Int64, warn::Bool, force::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ThreadPinning ~/.julia/packages/ThreadPinning/HVVtE/src/pinning.jl:157
[6] pinthreads(pinning::Symbol; kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nthreads,), Tuple{Int64}}})
@ ThreadPinning ~/.julia/packages/ThreadPinning/HVVtE/src/pinning.jl:169
[7] macro expansion
@ ~/.julia/packages/ThreadPinning/HVVtE/src/ThreadPinning.jl:92 [inlined]
[8] top-level scope
@ ~/.julia/packages/SnoopPrecompile/UWvXF/src/SnoopPrecompile.jl:51
[9] include
@ ./Base.jl:419 [inlined]
[10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base ./loading.jl:1554
[11] top-level scope
@ stdin:1
in expression starting at /home//.julia/packages/ThreadPinning/HVVtE/src/ThreadPinning.jl:1
in expression starting at stdin:1
@DatName, please try again (with the updated main
branch).
Success. Thank you.
But FYI some tests are failing now:
Test Summary: | Pass Fail Error Broken Total Time
Package | 165 4 1 8 178 7.8s
test/runtests.jl | 165 4 1 8 178 7.8s
Helper | 6 6 0.9s
System Info | 73 73 0.2s
Pinning | 38 4 1 43 5.6s
Thread Pinning (explicit) | 16 16 0.1s
Thread Pinning (compact) | 4 4 8 0.7s
Thread Pinning (spread) | 4 4 0.0s
Thread Pinning (numa) | 4 4 0.0s
Thread Pinning (current) | 2 2 0.0s
Environment variables | 2 1 3 4.4s
First pin attempt | 6 6 0.1s
Querying | 14 14 0.1s
threadinfo | 2 2 0.3s
OMP | 15 8 23 0.4s
Preferences | 17 17 0.3s
ERROR: LoadError: Some tests did not pass: 165 passed, 4 failed, 1 errored, 8 broken
Testing Running tests...
β Warning: Could read `lscpu --all --extended` but number of online CPUs (128) doesn't match Sys.CPU_THREADS (20).
β @ ThreadPinning ~/.julia/packages/ThreadPinning/tgIiu/src/sysinfo.jl:79
β Warning: Could read `lscpu --all --extended` but number of online CPUs (128) doesn't match Sys.CPU_THREADS (20).
β @ ThreadPinning ~/.julia/packages/ThreadPinning/tgIiu/src/sysinfo.jl:79
β Warning: Could read `lscpu --all --extended` but number of online CPUs (40) doesn't match Sys.CPU_THREADS (20).
β @ ThreadPinning ~/.julia/packages/ThreadPinning/tgIiu/src/sysinfo.jl:79
β Warning: Could read `lscpu --all --extended` but number of online CPUs (50) doesn't match Sys.CPU_THREADS (20).
β @ ThreadPinning ~/.julia/packages/ThreadPinning/tgIiu/src/sysinfo.jl:79
Thread Pinning (compact): Test Failed at /home//.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:53
Expression: (getcpuids())[1:2] == 0:1
Evaluated: [0, 2] == 0:1
Stacktrace:
[1] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:464 [inlined]
[2] macro expansion
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:53 [inlined]
[3] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:1357 [inlined]
[4] top-level scope
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:50
β Warning: More Julia threads than CPU IDs to bind to. Some CPU threads will host multiple Julia threads!
β @ ThreadPinning ~/.julia/packages/ThreadPinning/tgIiu/src/pinning.jl:162
Thread Pinning (compact): Test Failed at /home//.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:55
Expression: getcpuids() == 0:nthreads() - 1
Evaluated: [0, 2, 4, 6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 0, 2, 4, 6, 8, 10] == 0:19
Stacktrace:
[1] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:464 [inlined]
[2] macro expansion
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:55 [inlined]
[3] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:1357 [inlined]
[4] top-level scope
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:50
Thread Pinning (compact): Test Failed at /home//.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:53
Expression: (getcpuids())[1:2] == 0:1
Evaluated: [0, 2] == 0:1
Stacktrace:
[1] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:464 [inlined]
[2] macro expansion
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:53 [inlined]
[3] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:1357 [inlined]
[4] top-level scope
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:50
β Warning: More Julia threads than CPU IDs to bind to. Some CPU threads will host multiple Julia threads!
β @ ThreadPinning ~/.julia/packages/ThreadPinning/tgIiu/src/pinning.jl:162
Thread Pinning (compact): Test Failed at /home//.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:55
Expression: getcpuids() == 0:nthreads() - 1
Evaluated: [0, 2, 4, 6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 0, 2, 4, 6, 8, 10] == 0:19
Stacktrace:
[1] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:464 [inlined]
[2] macro expansion
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:55 [inlined]
[3] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:1357 [inlined]
[4] top-level scope
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:50
Test Failed at none:2
Expression: getcpuids() == (cpuids_all())[1:Threads.nthreads()]
Evaluated: [0, 2, 4] == [0, 1, 2]
ERROR: There was an error during testing
Environment variables: Error During Test at /home//.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:86
Test threw exception
Expression: exec(`'using ThreadPinning, Test;
@test getcpuids() == cpuids_all()[1:Threads.nthreads()]'`)
failed process: Process(`/home//work/julia/julia-1.8.2/bin/julia -Cnative -J/home//work/julia/julia-1.8.2/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home//.julia/packages/ThreadPinning/tgIiu/test/.. -t 3 -e 'using ThreadPinning, Test;
@test getcpuids() == cpuids_all()[1:Threads.nthreads()]'`, ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error
@ ./process.jl:565 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:480
[3] run
@ ./process.jl:477 [inlined]
[4] exec
@ ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:84 [inlined]
[5] macro expansion
@ ~/work/julia/julia-1.8.2/share/julia/stdlib/v1.8/Test/src/Test.jl:464 [inlined]
[6] (::Main.var"##314".var"#5#9"{Main.var"##314".var"#exec#8"{String, Cmd}})()
@ Main.var"##314" ~/.julia/packages/ThreadPinning/tgIiu/test/pinning_test.jl:86
Success. Thank you.
Great.
But FYI some tests are failing now:
Can you update and try again? As soon as this works I'll tag a new patch release.
passes with two types of warning:
β Warning: Could read `lscpu --all --extended` but number of online CPUs (50) doesn't match Sys.CPU_THREADS (20).
β @ ThreadPinning ~/.julia/packages/ThreadPinning/ljr8h/src/sysinfo.jl:79
β Warning: More Julia threads than CPU IDs to bind to. Some CPU threads will host multiple Julia threads!
β @ ThreadPinning ~/.julia/packages/ThreadPinning/ljr8h/src/pinning.jl:162
Test Summary: | Pass Broken Total Time
Package | 170 8 178 7.2s
Second warning is fine/expected. First warning is a bit strange: I don't understand the "online CPUs (50)" part because your (UPDATE: Nevermind, the first warning is also expected)lscpu
output only shows 20 and that number should come directly from there...
In any case, thanks for the input and sorry for the inconvenience. I'll tag a new patch release in a few minutes.
I am trying to update to version 0.6.0, but: