How to understand thread count as reported by versioninfo()?

Before Julia 1.10, number of threads reported by versioninfo() was correct. For example, when started with 8 threads, Julia 1.9.4 shows the following:

julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 ร— 12th Gen Intel(R) Core(TM) i5-1240P
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, alderlake)
  Threads: 8 on 16 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
  JULIA_PKG_USE_CLI_GIT = true
  JULIA_IMAGE_THREADS = 1

However, with Julia 1.10, the number of threads within Platform Info is reported as 11 instead of 8.

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 ร— 12th Gen Intel(R) Core(TM) i5-1240P
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
  Threads: 11 on 16 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
  JULIA_PKG_USE_CLI_GIT = true

Is this a bug or am I missing something?

1 Like

Some threads are GC threads: Command-line Interface ยท The Julia Language

On the master Git branch (the future v1.11), versioninfo() is finer grained, when started with ./julia -t5, versioninfo() outputs Threads: 5 default, 0 interactive, 2 GC (on 8 virtual cores).

1 Like

This was improved here by Ian:

2 Likes

I see. Thanks for sharing the link!

Starting Julia with --gcthreads=1 seems to fix the issue.

$ julia -t 8 --gcthreads 1 -q

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 ร— 12th Gen Intel(R) Core(TM) i5-1240P
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
  Threads: 8 on 16 virtual cores
Environment:
  JULIA_PKG_USE_CLI_GIT = true