Repository navigation
Build internal libraries as shared libraries in Python wheels - #390
Merged
Merged
Conversation
Static internal libraries copied their objects, including each CUDA fatbin, into every Python module that linked them. The BFGS minimizer kernels alone were duplicated across four modules, which pushed wheels past 150 MB. Build the internal libraries as shared libraries installed next to the modules, link the shared CUDA runtime, and add $ORIGIN to the rpath that repair_wheel.sh writes. Link etkdg_stages to etkdg_impl, which provides the symbols it uses, instead of etkdg; the old link formed a cycle that CMake only permits among static libraries.
Contributor
[Medium impact] The PR appears safe to merge; no new blocking issues were found.
|
Shared libraries resolve their own dependencies, so: - Launch reduceEnergiesKernel through FFKernelUtils::launchReduceEnergiesKernel in the library that defines it. CUDA 13 gives kernel host stubs hidden visibility, so another library cannot launch the kernel directly. This replaces the identical MMFF and DistGeom launchers. - Declare the libraries each test links instead of relying on static libraries to forward their private dependencies. - Build conformer_checkers only with tests or benchmarks so wheels do not install it.
evasnow1992
reviewed
Oct 30, 2026
evasnow1992
approved these changes
Oct 30, 2026
evasnow1992
left a comment
Collaborator
There was a problem hiding this comment.
Just one minor comment. The changes look good to me overall! Thanks for addressing the PyPI artifact size limit issue!
The header still described patching only the _*.so modules without the $ORIGIN entry for the internal shared libraries.
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.
Static internal libraries copied their objects, including each CUDA fatbin, into every Python module that linked them. The BFGS minimizer kernels alone were duplicated across four modules, which pushed wheels past 150 MB.
Build the internal libraries as shared libraries installed next to the modules, link the shared CUDA runtime, and add $ORIGIN to the rpath that repair_wheel.sh writes. Link etkdg_stages to etkdg_impl, which provides the symbols it uses, instead of etkdg; the old link formed a cycle that CMake only permits among static libraries.