@@ -370,8 +370,8 @@ jobs:
370370 PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
371371 PYTHON_EXECUTABLE=python bash examples/xnnpack/quantization/test_quantize.sh "${BUILD_TOOL}" mv2
372372
373- test-binary-size -linux-gcc :
374- name : test-binary-size -linux-gcc
373+ test-pybind-build -linux :
374+ name : test-pybind-build -linux
375375 uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
376376 permissions :
377377 id-token : write
@@ -389,22 +389,14 @@ jobs:
389389 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
390390 conda activate "${CONDA_ENV}"
391391
392- ./install_requirements.sh --use-pt-pinned-commit
393392 # build module for executorch.extension.pybindings.portable_lib
394- bash test/build_size_test.sh
395- strip cmake-out/test/size_test
396- output=$(ls -la cmake-out/test/size_test)
397- arr=($output)
398- size=${arr[4]}
399- # threshold=48120 on devserver with gcc11.4
400- # todo(lfq): update once binary size is below 50kb.
401- threshold="63776"
402- if [[ "$size" -le "$threshold" ]]; then
403- echo "Success $size <= $threshold"
404- else
405- echo "Fail $size > $threshold"
406- exit 1
407- fi
393+ BUILD_TOOL="cmake"
394+ PYTHON_EXECUTABLE=python \
395+ CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
396+ bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
397+
398+ # see if we can import the module successfully
399+ python -c "from executorch.extension.pybindings import portable_lib; print('success!')"
408400
409401 test-binary-size-linux :
410402 name : test-binary-size-linux
@@ -413,10 +405,22 @@ jobs:
413405 id-token : write
414406 contents : read
415407 strategy :
408+ matrix :
409+ include :
410+ - runner : linux.2xlarge
411+ docker-image : ci-image:executorch-ubuntu-22.04-gcc9
412+ threshold : 51504
413+ - runner : linux.2xlarge
414+ docker-image : ci-image:executorch-ubuntu-22.04-clang12
415+ threshold : 51784
416+ - runner : linux.arm64.2xlarge
417+ docker-image : ci-image:executorch-ubuntu-22.04-gcc11-aarch64
418+ threshold : 51784
416419 fail-fast : false
420+
417421 with :
418- runner : linux.2xlarge
419- docker-image : ci-image:executorch-ubuntu-22.04-clang12
422+ runner : ${{ matrix.runner }}
423+ docker-image : ${{ matrix.docker-image }}
420424 submodules : ' recursive'
421425 ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
422426 timeout : 90
@@ -426,14 +430,13 @@ jobs:
426430 conda activate "${CONDA_ENV}"
427431
428432 ./install_requirements.sh --use-pt-pinned-commit
429-
430433 # build module for executorch.extension.pybindings.portable_lib
431434 bash test/build_size_test.sh
432435 strip cmake-out/test/size_test
433436 output=$(ls -la cmake-out/test/size_test)
434437 arr=($output)
435438 size=${arr[4]}
436- threshold="51752 "
439+ threshold="${{ matrix.threshold }} "
437440 if [[ "$size" -le "$threshold" ]]; then
438441 echo "Success $size <= $threshold"
439442 else
0 commit comments