Lazy Julia loading via juliacall: import time 215s -> 6.4s#28
Open
mesonepigreco wants to merge 3 commits into
Open
Lazy Julia loading via juliacall: import time 215s -> 6.4s#28mesonepigreco wants to merge 3 commits into
mesonepigreco wants to merge 3 commits into
Conversation
Replace the eager PyJulia/PyCall initialization at import time with a lazy bridge (Modules/JuliaExt.py). The Julia runtime now boots at the first actual use of MODE_FAST_JULIA instead of at "import tdscha", and the backend is juliacall (PythonCall.jl), which has no libpython coupling: no python-jl, no PyCall rebuilds, and Julia is installed automatically on fresh machines through the shipped juliapkg.json. - Remove the triplicated eager init blocks in DynamicalLanczos.py and the one in QSpaceLanczos.py; route all julia.Main call sites through the JuliaExt proxy (numpy <-> Julia Array conversions preserve PyJulia call semantics with the strictly-typed kernel signatures). - is_julia_enabled() / __JULIA_EXT__ keep their meaning (backend availability) without booting the runtime. - Default to a single Julia thread (as PyJulia did): the Threads.@threads kernels in tdscha_core.jl race on shared buffers with >1 thread (see julia_design.md section 7). - New optional extra: pip install tdscha[julia] -> juliacall. - SSCHA_JULIA_BACKEND env var: juliacall | pyjulia (legacy) | none. - Design and measurements documented in julia_design.md; docs updated. A companion patch with the same bridge is needed in python-sscha (sscha.Ensemble had the same eager pattern, worth 194s of the total). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Bump version in pyproject.toml and meson.build from 1.6.3 to 1.7.0 - Add Examples/ensemble_gold/ (50-config converged SSCHA ensemble, 3x3x3 gold supercell) for non-TRI q-point testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the eager PyJulia/PyCall initialization at import time with a lazy bridge (Modules/JuliaExt.py). The Julia runtime now boots at the first actual use of MODE_FAST_JULIA instead of at "import tdscha", and the backend is juliacall (PythonCall.jl), which has no libpython coupling: no python-jl, no PyCall rebuilds, and Julia is installed automatically on fresh machines through the shipped juliapkg.json.
A companion patch with the same bridge is needed in python-sscha (sscha.Ensemble had the same eager pattern, worth 194s of the total).