Skip to content

Commit f48c314

Browse files
huydhnfacebook-github-bot
authored andcommitted
Pin PyTorch nightly in Executorch Linux CI (20230731) (#31)
Summary: Per our discussion today, let's pin PyTorch nightly for now till we have CI in place to safely update this. The nightly version could be updated manually Pull Request resolved: #31 Reviewed By: dbort Differential Revision: D47923775 Pulled By: huydhn fbshipit-source-id: c2bd6e4e0db620369b4f1e7cc6ff3c867e55923c
1 parent 6a9fe14 commit f48c314

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

.ci/docker/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ OS=ubuntu
1616
OS_VERSION=22.04
1717
CLANG_VERSION=12
1818
PYTHON_VERSION=3.10
19-
MINICONDA_VERSION='23.5.1-0'
19+
MINICONDA_VERSION=23.5.1-0
20+
21+
# TODO: Pin PyTorch version for now until we have the CI in place to update this
22+
# safely
23+
TORCH_VERSION=2.1.0.dev20230731
2024

2125
docker build \
2226
--no-cache \
@@ -25,6 +29,7 @@ docker build \
2529
--build-arg "CLANG_VERSION=${CLANG_VERSION}" \
2630
--build-arg "PYTHON_VERSION=${PYTHON_VERSION}" \
2731
--build-arg "MINICONDA_VERSION=${MINICONDA_VERSION}" \
32+
--build-arg "TORCH_VERSION=${TORCH_VERSION}" \
2833
-f "${OS}"/Dockerfile \
2934
"$@" \
3035
.

.ci/docker/common/install_conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ install_pip_dependencies() {
4040
pushd /opt/conda
4141
# Install all Python dependencies, including PyTorch
4242
pip_install -r /opt/conda/requirements-ci.txt
43-
pip_install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
43+
pip_install --pre torch=="${TORCH_VERSION}" --index-url https://download.pytorch.org/whl/nightly/cpu
4444
popd
4545
}
4646

.ci/docker/ubuntu/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ RUN bash ./install_user.sh && rm install_user.sh
2626
# Install conda and other dependencies
2727
ARG MINICONDA_VERSION
2828
ARG PYTHON_VERSION
29+
ARG TORCH_VERSION
2930
ENV PYTHON_VERSION=$PYTHON_VERSION
3031
ENV PATH /opt/conda/envs/py_$PYTHON_VERSION/bin:/opt/conda/bin:$PATH
3132
COPY requirements-ci.txt /opt/conda/

.github/workflows/pull.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,19 @@ jobs:
2222
submodules: 'true'
2323
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
2424
script: |
25-
WORKSPACE=$(pwd)
25+
PYTHON_VERSION=3.10
26+
# TODO: Figure out why /opt/conda/envs/py_$PYTHON_VERSION/bin is not in the path
27+
# here, as it's there in the container
28+
export PATH="/opt/conda/envs/py_${PYTHON_VERSION}/bin:${PATH}"
2629
27-
pushd "${HOME}"
28-
# Create the softlink to the workspace as install.sh requires to run from its parent directory
29-
ln -s "${WORKSPACE}" executorch
30-
# Install executorch
31-
pushd executorch
32-
33-
34-
# Install nightly pytorch
35-
pip3 install --pre torch -i https://download.pytorch.org/whl/nightly/cpu
3630
# Install executorch
3731
pip3 install .
38-
3932
# Just print out the list of packages for debugging
4033
pip3 list
4134
4235
# Build executorch runtime
4336
buck2 build //examples/executor_runner:executor_runner
44-
4537
# Export a test model
4638
python3 -m examples.export.export_example --model_name="linear"
47-
4839
# Run test model
4940
buck2 run //examples/executor_runner:executor_runner -- --model_path ./linear.ff
50-
51-
popd

0 commit comments

Comments
 (0)