fix: Fix bugs in installation from scratch having wrong directory dependancy - #160
Open
SecretSettler wants to merge 1 commit into
Open
fix: Fix bugs in installation from scratch having wrong directory dependancy#160SecretSettler wants to merge 1 commit into
SecretSettler wants to merge 1 commit into
Conversation
…ion to batchgen install
install_batchgen_kernels and install_batchgen each recomputed SCRIPT_DIR via
$(dirname "${BASH_SOURCE[0]}") after earlier install_* functions had cd'd into
/tmp/batchgen_deps/DeepGEMM. With BASH_SOURCE[0] holding the relative path
./scripts/install_deps.sh, dirname returned ./scripts and the cd failed
(line 217: cd: ./scripts: No such file or directory).
Hoist SCRIPT_DIR/BATCHGEN_DIR to a single absolute-path computation at the
top of the script so subsequent cd's don't invalidate them.
Also add --no-build-isolation to install_batchgen -- its setup.py imports
torch at module load (same constraint as batchgen_kernels), so the default
isolated build env raises ModuleNotFoundError: No module named 'torch'.
SecretSettler
requested review from
Andrewxu313 and
lausannel
and removed request for
Andrewxu313
May 24, 2026 23:39
Andrewxu313
pushed a commit
that referenced
this pull request
May 25, 2026
BatchGen's setup.py does `import torch` and `from op_builder.all_ops import ALL_OPS` at module load (op_builder uses torch.utils.cpp_extension). The previous `python -m build --wheel` ran setup.py inside a PEP 517 isolated build env that had neither torch nor the compiled-extension deps, so it could never have worked. Audit findings: - publish-test.yml (same `python -m build --wheel`) has had no successful run since 2025-07; last 4 attempts cancelled at 7s. - build.yml was bound to master/dev/release* — never ran against main, so the breakage was invisible. - The canonical install path is scripts/install_deps.sh, which uses `pip install --no-build-isolation .` after torch is staged. PR #160 documents the same constraint. Replace the build step with: - Free pre-installed CUDA + unused toolchains (disk budget). - apt install libnuma-dev (numa.h for core/Parameter_Server/posix_shm.cpp). - cuda-install.sh + libcufile-dev-12-1 (the -lcufile linkage in core_engine.py needs the split-out cufile package). - Pre-install torch + numpy + ninja + setuptools + wheel + packaging + pybind11 in the runner Python env. - `pip wheel . --no-deps --no-build-isolation` so the build env IS the runner env that has torch. Companion fix in 3822cd0 (absolutise CUDA include paths) is required for the actual nvcc/c++ invocations to find external/spdlog headers once we get past the import-time errors.
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.
Description
This pull request refactors how script and repository root directories are determined in the
install_deps.shscript to avoid redundant computation and ensure correctness when changing directories during dependency installation.Refactoring and reliability improvements:
SCRIPT_DIRandBATCHGEN_DIRare now computed once at the start of the script, ensuring these variables remain correct even if the working directory changes later in the script.SCRIPT_DIRandBATCHGEN_DIRinside theinstall_batchgen_kernelsandinstall_batchgenfunctions has been removed, simplifying these functions and reducing the risk of errors. [1] [2]Dependency installation:
pip installcommand for BatchGen now explicitly uses--no-build-isolationfor consistency with the kernel extensions installation.stall_batchgen each recomputed SCRIPT_DIR viaHoist SCRIPT_DIR/BATCHGEN_DIR to a single absolute-path computation at the top of the script so subsequent cd's don't invalidate them.
Also add --no-build-isolation to install_batchgen -- its setup.py imports torch at module load (same constraint as batchgen_kernels), so the default isolated build env raises ModuleNotFoundError: No module named 'torch'.
Motivation
Fix install bugs
Type of Change
Checklist