Repository navigation
build: compile the extension modules in parallel (SBD_BUILD_JOBS) - #96
Merged
Merged
Conversation
Each module is one large compile of src/sbd/bindings.cpp, so building them one at a time left the machine nearly idle. They now compile in parallel, all at once by default up to the CPU count; SBD_BUILD_JOBS sets how many, for build hosts short of memory. Every module compiles the same source file, so each gets its own temp directory: in a shared one their objects would overwrite each other and a module could link another's code. tox passes SBD_BUILD_JOBS through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Each extension module is one large compile of
src/sbd/bindings.cpp, andsetup.py build_extbuilt them one at a time, leaving the build host nearly idle. They now compile in parallel.SBD_BUILD_JOBSsets how many modules compile at once. Leave it unset to build all of them in parallel, capped by the CPU count. Set a smaller number, or1, on a build host or container short of memory: a Thrust module's compile alone peaks near 4 GB. An explicitbuild_ext -j Nstill takes precedence, and an invalid value stops the build with an error.-D_UHF.tox.inipassesSBD_BUILD_JOBSthrough, and INSTALL.md documents it. CI is unchanged and uses the default.Build time
SBD_BUILD_JOBS=1)Checked
__sbd_uhf__,__sbd_offload_target__,__sbd_has_evaluator__,__sbd_has_caop__), so none linked another's object.cpu,gpuandgpu-ompbackends built in parallel.SBD_BUILD_JOBS(0,x) stops the build with an error.🤖 Generated with Claude Code