Skip to content

fix: Fix bugs in installation from scratch having wrong directory dependancy - #160

Open
SecretSettler wants to merge 1 commit into
mainfrom
fix/install-deps-bugs
Open

fix: Fix bugs in installation from scratch having wrong directory dependancy#160
SecretSettler wants to merge 1 commit into
mainfrom
fix/install-deps-bugs

Conversation

@SecretSettler

Copy link
Copy Markdown
Collaborator

Description

This pull request refactors how script and repository root directories are determined in the install_deps.sh script to avoid redundant computation and ensure correctness when changing directories during dependency installation.

Refactoring and reliability improvements:

  • The absolute paths for SCRIPT_DIR and BATCHGEN_DIR are now computed once at the start of the script, ensuring these variables remain correct even if the working directory changes later in the script.
  • Redundant re-computation of SCRIPT_DIR and BATCHGEN_DIR inside the install_batchgen_kernels and install_batchgen functions has been removed, simplifying these functions and reducing the risk of errors. [1] [2]

Dependency installation:

  • The pip install command for BatchGen now explicitly uses --no-build-isolation for consistency with the kernel extensions installation.stall_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'.

Motivation

Fix install bugs

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • I have read the CONTRIBUTION guide.
  • I have updated the tests (if applicable).
  • I have updated the documentation (if applicable).

…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
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.
@github-actions github-actions Bot added the ci:run Trigger build + GPU regression on H20 label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run Trigger build + GPU regression on H20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant