Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ DEEPGEMM_VERSION="v2.1.1.post3"
# Installation directory (defaults to temp, can be overridden)
INSTALL_DIR="${BATCHGEN_INSTALL_DIR:-/tmp/batchgen_deps}"

# Absolute paths to this script and the BatchGen repo root. Computed once at
# entry so they stay valid even after install_* functions cd elsewhere.
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
BATCHGEN_DIR="$(dirname -- "$SCRIPT_DIR")"

print_step() {
echo -e "${BLUE}==>${NC} $1"
}
Expand Down Expand Up @@ -214,9 +219,6 @@ install_deepgemm() {
install_batchgen_kernels() {
print_step "Installing batchgen_kernels (AOT-compiled CUDA kernel extensions)..."

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BATCHGEN_DIR="$(dirname "$SCRIPT_DIR")"

if [[ -f "$BATCHGEN_DIR/batchgen_kernels/setup.py" ]]; then
cd "$BATCHGEN_DIR/batchgen_kernels"
pip install . --no-build-isolation
Expand All @@ -229,13 +231,9 @@ install_batchgen_kernels() {
install_batchgen() {
print_step "Installing BatchGen..."

# Find BatchGen directory (script is in scripts/, BatchGen is parent)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BATCHGEN_DIR="$(dirname "$SCRIPT_DIR")"

if [[ -f "$BATCHGEN_DIR/setup.py" ]]; then
cd "$BATCHGEN_DIR"
pip install .
pip install . --no-build-isolation
print_success "BatchGen installed"
else
print_error "Could not find BatchGen setup.py at $BATCHGEN_DIR"
Expand Down