Skip to content
Closed
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
12 changes: 8 additions & 4 deletions compiler/one-cmds/one-prepare-venv
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ fi

# Install PyTorch and ONNX related
# NOTE set ONE_PREPVENV_TORCH_SOURCE to override options for source URL.
TORCH_SOURCE_OPTION="--extra-index-url https://download.pytorch.org/whl/cpu"
if [[ ! -z "$ONE_PREPVENV_TORCH_SOURCE" ]]; then
TORCH_SOURCE_OPTION=""
if [[ -n "$ONE_PREPVENV_PIP_OPTION" ]]; then
echo "ONE_PREPVENV_PIP_OPTION is set; skipping default torch source option."
elif [[ -n "$ONE_PREPVENV_TORCH_SOURCE" ]]; then
TORCH_SOURCE_OPTION="${ONE_PREPVENV_TORCH_SOURCE}"
else
TORCH_SOURCE_OPTION="--extra-index-url https://download.pytorch.org/whl/cpu"
fi
# TODO remove torch message
echo "Torch from '${ONE_PREPVENV_TORCH_SOURCE}' -> '${TORCH_SOURCE_OPTION}'"

echo "Torch source option: '${TORCH_SOURCE_OPTION}'"
Comment on lines +99 to +108
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The control flow looks clearer than before, and skipping the default torch index when ONE_PREPVENV_PIP_OPTION is explicitly set makes sense.

One thing I want to confirm is whether it is intended to ignore ONE_PREPVENV_TORCH_SOURCE entirely whenever ONE_PREPVENV_PIP_OPTION is set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for the record, ONE_PREPVENV_TORCH_SOURCE was to override the torch source URL to internal package server for CI and for inhouse developres.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I mistakenly saw both were same option: ONE_PREPVENV_PIP_OPTION and ONE_PREPVENV_TORCH_SOURCE. I think I can ignore TORCH_SOURCE_OPTION with current codes.

Let's close this PR.


${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade pip setuptools

Expand Down
Loading