Skip to content

Fast julia startup#419

Open
mesonepigreco wants to merge 3 commits into
masterfrom
fast_julia_startup
Open

Fast julia startup#419
mesonepigreco wants to merge 3 commits into
masterfrom
fast_julia_startup

Conversation

@mesonepigreco

Copy link
Copy Markdown
Collaborator

Reducing the startup time of the code by a factor of 30
replacing PyCall with juliacall.

mesonepigreco and others added 3 commits June 11, 2026 08:21
Fix issue for parallel print error
To test if the code works correctly in parallel
Companion patch of tdscha's fast_julia_startup. sscha.Ensemble used to boot
the Julia runtime through PyJulia at import time; on any machine where
PyCall.jl is not built for the exact running libpython this falls back to
Julia(compiled_modules=False) and recompiles PyCall at every Python launch
(~3 minutes per import).

- New Modules/JuliaExt.py lazy bridge: juliacall (PythonCall.jl) backend by
  default (no libpython coupling, auto-installs Julia via the shipped
  juliapkg.json), legacy pyjulia reused if already booted in the process.
- Ensemble.py: the eager init block is replaced by a lazy stand-in object,
  so all julia.Main.* call sites work unchanged and the runtime boots at
  the first fourier-gradient evaluation instead of at import.
- __JULIA_EXT__ keeps its meaning (backend availability, no boot):
  SchaMinimizer.use_julia and Ensemble.fourier_gradient defaults work as
  before; no change needed there.
- Julia keeps running single-threaded by default, as with PyJulia
  (JULIA_NUM_THREADS is honored).
- New optional extra: pip install python-sscha[julia] -> juliacall.
- SSCHA_JULIA_BACKEND env var: juliacall | pyjulia (legacy) | none.

Design and measurements: julia_design.md in the tdscha repository.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mesonepigreco mesonepigreco added this to the 1.7 milestone Jun 12, 2026
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.

1 participant