Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AutoGluon to use uv during setup.sh #643

Merged
merged 1 commit into from
Nov 2, 2024
Merged
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
30 changes: 21 additions & 9 deletions frameworks/AutoGluon/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# exit when any command fails
set -e

# Uncomment for debugging installation
# set -x

HERE=$(dirname "$0")
VERSION=${1:-"stable"}
REPO=${2:-"https://github.com/autogluon/autogluon.git"}
Expand All @@ -14,30 +17,39 @@ fi
# creating local venv
. ${HERE}/../shared/setup.sh ${HERE} true

# Below fixes seg fault on MacOS due to bug in libomp: https://github.com/awslabs/autogluon/issues/1442
# aka "{xyz}/automlbenchmark/frameworks/AutoGluon/venv/bin/python"
PY_EXEC_NO_ARGS="$(cut -d' ' -f1 <<<"$py_exec")"

# Below fixes seg fault on MacOS due to bug in libomp: https://github.com/autogluon/autogluon/issues/1442
if [[ -x "$(command -v brew)" ]]; then
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb -P "${HERE}/lib"
brew install "${HERE}/lib/libomp.rb"
fi

PIP install --upgrade pip
PIP install --upgrade setuptools wheel

PIP install uv
UV="${PY_EXEC_NO_ARGS} -m uv"

if [[ "$VERSION" == "stable" ]]; then
PIP install --no-cache-dir -U "${PKG}"
PIP install --no-cache-dir -U "${PKG}.tabular[skex]"
$UV pip install --no-cache-dir -U "${PKG}"
$UV pip install --no-cache-dir -U "${PKG}.tabular[skex]"
elif [[ "$VERSION" =~ ^[0-9] ]]; then
PIP install --no-cache-dir -U "${PKG}==${VERSION}"
PIP install --no-cache-dir -U "${PKG}.tabular[skex]==${VERSION}"
$UV pip install --no-cache-dir -U "${PKG}==${VERSION}"
$UV pip install --no-cache-dir -U "${PKG}.tabular[skex]==${VERSION}"
else
TARGET_DIR="${HERE}/lib/${PKG}"
rm -Rf ${TARGET_DIR}
git clone --depth 1 --single-branch --branch ${VERSION} --recurse-submodules ${REPO} ${TARGET_DIR}
cd ${TARGET_DIR}
PY_EXEC_NO_ARGS="$(cut -d' ' -f1 <<<"$py_exec")"
PY_EXEC_DIR=$(dirname "$PY_EXEC_NO_ARGS")
env PATH="$PY_EXEC_DIR:$PATH" bash -c ./full_install.sh
PIP install -e tabular/[skex]

# Install in non-editable mode to avoid interaction with other pre-existing AutoGluon installations
env PATH="$PY_EXEC_DIR:$PATH" bash -c "./full_install.sh --non-editable"
$UV pip install tabular/[skex]
fi

# Note: `setuptools` being present in the venv will cause torch==1.4.x to raise an exception for an unknown reason in AMLB.
echo "Finished setup, testing autogluon install..."

PY -c "from autogluon.tabular.version import __version__; print(__version__)" >> "${HERE}/.setup/installed"
Loading