Skip to content
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions tools/AutoTuner/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ __pycache__/
# Autotuner env
autotuner_env
.env
.venv
17 changes: 17 additions & 0 deletions tools/AutoTuner/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: clearcache init reqs test

clearcache:
@echo "Cleaning python cache"
@find . -type d -name __pycache__ -exec rm -r {} \+

init:
@echo "Installing python environment"
@./installer.sh

reqs:
@echo "Compiling requirements"
@rm -f requirements.txt
@.venv/bin/pip-compile --output-file=requirements.txt requirements.in

test:
@echo "Running tests"
22 changes: 21 additions & 1 deletion tools/AutoTuner/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,25 @@ script_dir="$(dirname "${BASH_SOURCE[0]}")"
venv_name="autotuner_env"
python3 -m venv "$script_dir/$venv_name"
source "$script_dir/$venv_name/bin/activate"
pip3 install -U -r $script_dir/requirements.txt
retry_count=0
max_retries=5
success=false

while [[ $retry_count -lt $max_retries ]]; do
if pip3 cache purge && pip3 install --no-cache-dir -U -r "$script_dir/requirements.txt"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cache purge required with the --no-cache-dir option or are they redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not mutually exclusive. Pip cache purge might be needed if system had cache before, and no cache dir just ensures no future caching is done.

success=true
break
else
retry_count=$((retry_count + 1))
echo "Attempt $retry_count failed. Retrying in 1 minute..."
sleep 60
fi
done

if [ "$success" = false ]; then
echo "Failed to install requirements after $max_retries attempts."
deactivate
exit 1
fi

deactivate
12 changes: 12 additions & 0 deletions tools/AutoTuner/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ray[default,tune]==2.9.3
ax-platform>=0.3.3,<=0.3.7
hyperopt==0.2.7
optuna==3.6.0
pandas>=2.0,<=2.2.1
bayesian-optimization==1.4.0
colorama==0.4.6
tensorboard>=2.14.0,<=2.16.2
protobuf==3.20.3
SQLAlchemy==1.4.17
urllib3<=1.26.15
pip-tools==7.4.1
Loading
Loading