Skip to content

Commit d8c9c74

Browse files
Upgrade Docker container from gcc9 to gcc11 and add gcc9-nopytorch variant (#16227)
- Rename executorch-ubuntu-22.04-gcc9 to executorch-ubuntu-22.04-gcc11 with GCC_VERSION=11 - Add new executorch-ubuntu-22.04-gcc9-nopytorch container that skips PyTorch build from source (faster builds, smaller image) - Add SKIP_PYTORCH build arg to Dockerfile to conditionally skip PyTorch installation - Update CI jobs: - test-setup-linux-gcc: uses gcc11 (needs pre-built PyTorch) - test-openvino-linux: uses gcc11 (needs pre-built PyTorch) - test-binary-size-linux-gcc: uses gcc9-nopytorch with pinned nightly PyTorch installed at runtime --------- Co-authored-by: Copilot <[email protected]>
1 parent c493e2d commit d8c9c74

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.ci/docker/build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ MINICONDA_VERSION=23.10.0-1
2323
BUCK2_VERSION=$(cat ci_commit_pins/buck2.txt)
2424

2525
case "${IMAGE_NAME}" in
26-
executorch-ubuntu-22.04-gcc9)
26+
executorch-ubuntu-22.04-gcc11)
27+
LINTRUNNER=""
28+
GCC_VERSION=11
29+
;;
30+
executorch-ubuntu-22.04-gcc9-nopytorch)
2731
LINTRUNNER=""
2832
GCC_VERSION=9
33+
SKIP_PYTORCH=yes
2934
;;
3035
executorch-ubuntu-22.04-clang12)
3136
LINTRUNNER=""
@@ -95,6 +100,7 @@ docker build \
95100
--build-arg "QNN_SDK=${QNN_SDK:-}" \
96101
--build-arg "MEDIATEK_SDK=${MEDIATEK_SDK:-}" \
97102
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
103+
--build-arg "SKIP_PYTORCH=${SKIP_PYTORCH:-}" \
98104
-f "${OS}"/Dockerfile \
99105
"$@" \
100106
.

.ci/docker/ubuntu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ ENV SCCACHE_S3_KEY_PREFIX executorch
6464
ENV SCCACHE_REGION us-east-1
6565

6666
ARG TORCH_VERSION
67+
ARG SKIP_PYTORCH
6768
COPY ./common/install_pytorch.sh install_pytorch.sh
6869
COPY ./common/utils.sh utils.sh
69-
RUN bash ./install_pytorch.sh && rm install_pytorch.sh utils.sh
70+
RUN if [ -z "${SKIP_PYTORCH}" ]; then bash ./install_pytorch.sh; fi && rm install_pytorch.sh utils.sh
7071

7172
ARG LINTRUNNER
7273
# Install lintrunner if needed

.github/workflows/docker-builds.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
matrix:
3434
runner: [linux.4xlarge]
3535
docker-image-name: [
36-
executorch-ubuntu-22.04-gcc9,
36+
executorch-ubuntu-22.04-gcc11,
37+
executorch-ubuntu-22.04-gcc9-nopytorch,
3738
executorch-ubuntu-22.04-clang12,
3839
executorch-ubuntu-22.04-linter,
3940
executorch-ubuntu-22.04-arm-sdk,
@@ -70,7 +71,7 @@ jobs:
7071

7172
- name: Build docker image
7273
id: build-docker-image
73-
timeout-minutes: 45
74+
timeout-minutes: 145
7475
uses: pytorch/test-infra/.github/actions/calculate-docker-image@main
7576
with:
7677
docker-image-name: ci-image:${{ matrix.docker-image-name }}

.github/workflows/pull.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
fail-fast: false
5252
with:
5353
runner: linux.2xlarge
54-
docker-image: ci-image:executorch-ubuntu-22.04-gcc9
54+
docker-image: ci-image:executorch-ubuntu-22.04-gcc11
5555
submodules: 'recursive'
5656
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
5757
timeout: 90
@@ -391,7 +391,7 @@ jobs:
391391
fail-fast: false
392392
with:
393393
runner: linux.2xlarge
394-
docker-image: ci-image:executorch-ubuntu-22.04-gcc9
394+
docker-image: ci-image:executorch-ubuntu-22.04-gcc9-nopytorch
395395
submodules: 'recursive'
396396
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
397397
timeout: 90
@@ -400,15 +400,16 @@ jobs:
400400
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
401401
conda activate "${CONDA_ENV}"
402402
403-
./install_requirements.sh --use-pt-pinned-commit
403+
./install_requirements.sh
404404
# build module for executorch.extension.pybindings.portable_lib
405405
bash test/build_size_test.sh
406406
strip cmake-out/test/size_test
407407
output=$(ls -la cmake-out/test/size_test)
408408
arr=($output)
409409
size=${arr[4]}
410-
# threshold=48120 on devserver with gcc11.4
410+
# threshold=48120 on devserver with gcc9
411411
# todo(lfq): update once binary size is below 50kb.
412+
# Note: using gcc9-nopytorch container with pinned nightly PyTorch
412413
threshold="63776"
413414
if [[ "$size" -le "$threshold" ]]; then
414415
echo "Success $size <= $threshold"
@@ -793,7 +794,7 @@ jobs:
793794
fail-fast: false
794795
with:
795796
runner: linux.2xlarge
796-
docker-image: ci-image:executorch-ubuntu-22.04-gcc9
797+
docker-image: ci-image:executorch-ubuntu-22.04-gcc11
797798
submodules: 'recursive'
798799
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
799800
timeout: 90

0 commit comments

Comments
 (0)