File tree Expand file tree Collapse file tree 8 files changed +40
-8
lines changed Expand file tree Collapse file tree 8 files changed +40
-8
lines changed Original file line number Diff line number Diff line change 2222# have already been installed, so we use PyTorch build from source here instead
2323# of nightly. This allows CI to test against latest commits from PyTorch
2424install_executorch " use-pt-pinned-commit"
25- build_executorch_runner " ${BUILD_TOOL} "
25+ build_executorch_runner " ${BUILD_TOOL} " " ${2 :- Release} "
2626
2727if [[ " ${GITHUB_BASE_REF:- } " == * main* || " ${GITHUB_BASE_REF:- } " == * gh* ]]; then
2828 do_not_use_nightly_on_ci
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ install_pytorch_and_domains
136136# We build PyTorch from source here instead of using nightly. This allows CI to test against
137137# the pinned commit from PyTorch
138138install_executorch " use-pt-pinned-commit"
139- build_executorch_runner " ${BUILD_TOOL} "
139+ build_executorch_runner " ${BUILD_TOOL} " " ${2 :- Release} "
140140
141141if [[ " ${GITHUB_BASE_REF:- } " == * main* || " ${GITHUB_BASE_REF:- } " == * gh* ]]; then
142142 do_not_use_nightly_on_ci
Original file line number Diff line number Diff line change 1414 exit 1
1515fi
1616
17+ BUILD_MODE=$2
18+ if [[ " ${BUILD_MODE:- } " =~ ^(Debug| Release)$ ]]; then
19+ echo " Running tests in build mode ${BUILD_MODE} ..."
20+ else
21+ echo " Unsupported build mode ${BUILD_MODE} , options are Debug or Release."
22+ exit 1
23+ fi
24+
1725# The generic Linux job chooses to use base env, not the one setup by the image
1826eval " $( conda shell.bash hook) "
1927CONDA_ENV=$( conda env list --json | jq -r " .envs | .[-1]" )
@@ -25,7 +33,7 @@ source .ci/scripts/setup-vulkan-linux-deps.sh
2533PYTHON_EXECUTABLE=python \
2634EXECUTORCH_BUILD_PYBIND=ON \
2735CMAKE_ARGS=" -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
28- .ci/scripts/setup-linux.sh " $BUILD_TOOL "
36+ .ci/scripts/setup-linux.sh " $BUILD_TOOL " " $BUILD_MODE "
2937
3038# Install llama3_2_vision dependencies.
3139PYTHON_EXECUTABLE=python ./examples/models/llama3_2_vision/install_requirements.sh
Original file line number Diff line number Diff line change 1414 exit 1
1515fi
1616
17+ BUILD_MODE=$2
18+ if [[ $BUILD_MODE =~ ^(Debug| Release)$ ]]; then
19+ echo " Running tests in build mode ${BUILD_MODE} ..."
20+ else
21+ echo " Unsupported build mode ${BUILD_MODE} , options are Debug or Release."
22+ exit 1
23+ fi
24+
1725bash .ci/scripts/setup-conda.sh
1826eval " $( conda shell.bash hook) "
1927
@@ -27,7 +35,7 @@ PYTHON_EXECUTABLE=python \
2735EXECUTORCH_BUILD_PYBIND=ON \
2836CMAKE_ARGS=" -DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
2937${CONDA_RUN} --no-capture-output \
30- .ci/scripts/setup-macos.sh cmake
38+ .ci/scripts/setup-macos.sh " ${BUILD_TOOL} " " ${BUILD_MODE} "
3139
3240# Install llama3_2_vision dependencies.
3341PYTHON_EXECUTABLE=python ./examples/models/llama3_2_vision/install_requirements.sh
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ build_executorch_runner_cmake() {
109109 pushd " ${CMAKE_OUTPUT_DIR} " || return
110110 # This command uses buck2 to gather source files and buck2 could crash flakily
111111 # on MacOS
112- retry cmake -DPYTHON_EXECUTABLE=" ${PYTHON_EXECUTABLE} " -DCMAKE_BUILD_TYPE=Release ..
112+ retry cmake -DPYTHON_EXECUTABLE=" ${PYTHON_EXECUTABLE} " -DCMAKE_BUILD_TYPE=" ${1 :- Release} " ..
113113 popd || return
114114
115115 if [ " $( uname) " == " Darwin" ]; then
@@ -124,7 +124,7 @@ build_executorch_runner() {
124124 if [[ $1 == " buck2" ]]; then
125125 build_executorch_runner_buck2
126126 elif [[ $1 == " cmake" ]]; then
127- build_executorch_runner_cmake
127+ build_executorch_runner_cmake " $2 "
128128 else
129129 echo " Invalid build tool $1 . Only buck2 and cmake are supported atm"
130130 exit 1
Original file line number Diff line number Diff line change 77 required : true
88 type : string
99 description : Name of the docker image to use.
10+ build-mode :
11+ required : true
12+ type : string
13+ description : Build mode to use, Debug or Release.
1014 build-tool :
1115 required : true
1216 type : string
3034 timeout : 90
3135 script : |
3236 set -eux
33- .ci/scripts/unittest-linux.sh "${{ inputs.build-tool }}"
37+ .ci/scripts/unittest-linux.sh "${{ inputs.build-tool }}" "${{ inputs.build-mode }}"
3438
3539 macos :
3640 uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
4145 ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
4246 script : |
4347 set -eux
44- .ci/scripts/unittest-macos.sh "${{ inputs.build-tool }}"
48+ .ci/scripts/unittest-macos.sh "${{ inputs.build-tool }}" "${{ inputs.build-mode }}"
Original file line number Diff line number Diff line change @@ -367,6 +367,7 @@ jobs:
367367 id-token : write
368368 contents : read
369369 with :
370+ build-mode : Debug
370371 build-tool : cmake
371372 docker-image : executorch-ubuntu-22.04-clang12
372373
@@ -376,6 +377,7 @@ jobs:
376377 id-token : write
377378 contents : read
378379 with :
380+ build-mode : Debug
379381 build-tool : buck2
380382 docker-image : executorch-ubuntu-22.04-clang12
381383
Original file line number Diff line number Diff line change @@ -489,3 +489,13 @@ jobs:
489489 PYTHON_EXECUTABLE=python bash examples/models/llama/install_requirements.sh
490490 # Test llama2
491491 PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh -model stories110M -build_tool "${BUILD_TOOL}" -mode "${MODE}" -dtype "${DTYPE}" -pt2e_quantize "${PT2E_QUANTIZE}"
492+
493+ unittest-release :
494+ uses : ./.github/workflows/_unittest.yml
495+ permissions :
496+ id-token : write
497+ contents : read
498+ with :
499+ build-mode : Release
500+ build-tool : cmake
501+ docker-image : executorch-ubuntu-22.04-clang12
You can’t perform that action at this time.
0 commit comments