Skip to content

Commit

Permalink
2024-03-15 nightly release (04fbaae)
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchbot committed Mar 15, 2024
1 parent 7a012a3 commit c005dd2
Show file tree
Hide file tree
Showing 476 changed files with 21,339 additions and 13,218 deletions.
2 changes: 1 addition & 1 deletion .ci/docker/ci_commit_pins/pytorch.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f5b99976adcbb01fd71bd0a39ea15bdac6c9e48a
6ca9ae4f8693639c395544327f7e362441a58c79
8 changes: 5 additions & 3 deletions .ci/docker/common/install_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ install_pip_dependencies() {
}

fix_conda_ubuntu_libstdcxx() {
cat /etc/issue
# WARNING: This is a HACK from PyTorch core to be able to build PyTorch on 22.04.
# The issue still exists with the latest conda 23.10.0-1 at the time of writing
# (2023/11/16).
# Specifically, ubuntu-20+ all comes lib libstdc++ newer than 3.30+, but anaconda
# is stuck with 3.29. So, remove libstdc++6.so.3.29 as installed by
# https://anaconda.org/anaconda/libstdcxx-ng/files?version=11.2.0
#
# PyTorch sev: https://github.com/pytorch/pytorch/issues/105248
# Ref: https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_conda.sh
if grep -e "[12][82].04.[623]" /etc/issue >/dev/null; then
if grep -e "2[02].04." /etc/issue >/dev/null; then
rm "/opt/conda/envs/py_${PYTHON_VERSION}/lib/libstdc++.so.6"
fi
}
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install_executorch() {
which pip
# Install executorch, this assumes that Executorch is checked out in the
# current directory
pip install . --no-build-isolation
pip install . --no-build-isolation -v
# Just print out the list of packages for debugging
pip list
}
Expand Down
2 changes: 2 additions & 0 deletions .github/pytorch-probot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
ciflow_push_tags:
- ciflow/nightly
- ciflow/trunk
- ciflow/binaries
- ciflow/binaries/all
12 changes: 10 additions & 2 deletions .github/workflows/_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
conda activate "${CONDA_ENV}"
BUILD_TOOL=${{ matrix.build-tool }}
# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python \
EXECUTORCH_BUILD_PYBIND=ON \
.ci/scripts/setup-linux.sh "${BUILD_TOOL}"
# Run pytest with coverage
pytest -n auto --cov=./ --cov-report=xml
Expand All @@ -59,8 +62,13 @@ jobs:
BUILD_TOOL=${{ matrix.build-tool }}
bash .ci/scripts/setup-conda.sh
# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python ${CONDA_RUN} EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python \
EXECUTORCH_BUILD_PYBIND=ON \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
# Run pytest with coverage
${CONDA_RUN} pytest -n auto --cov=./ --cov-report=xml
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/app-build.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Apple

on:
push:
branches:
- main
- release/*
pull_request:
paths:
- .ci/docker/**
- .github/workflows/app-build.yml
- install_requirements.sh
- backends/apple/**
- build/build_apple_frameworks.sh
- build/create_frameworks.sh
- build/test_ios_ci.sh
- examples/demo-apps/**
- extension/apple/**
- extension/module/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

jobs:
test-demo-ios:
name: test-demo-ios
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
runner: macos-latest-xlarge
python-version: '3.11'
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
WORKSPACE=$(pwd)
pushd "${WORKSPACE}/pytorch/executorch"
BUILD_TOOL=cmake
.ci/scripts/setup-conda.sh
# Setup MacOS dependencies as there is no Docker support on MacOS atm
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
# Build and test iOS Demo App
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
build/test_ios_ci.sh
popd
build-frameworks-ios:
name: build-frameworks-ios
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
runner: macos-latest-xlarge
python-version: '3.11'
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
upload-artifact: executorch.zip
timeout: 90
script: |
WORKSPACE=$(pwd)
pushd "${WORKSPACE}/pytorch/executorch"
BUILD_TOOL=cmake
VERSION="0.1.0"
OUTPUT="executorch-${VERSION}"
.ci/scripts/setup-conda.sh
# Setup MacOS dependencies as there is no Docker support on MacOS atm
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
# Install CoreML Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/coreml/scripts/install_requirements.sh
# Install MPS Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/mps/install_requirements.sh
# Build iOS Frameworks
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
build/build_apple_frameworks.sh --output="${OUTPUT}" --coreml --mps --portable --xnnpack
# Bundle iOS Frameworks
cp LICENSE "${OUTPUT}"
zip -r "${RUNNER_TEMP}/artifacts/${OUTPUT}.zip" "${OUTPUT}"
popd
57 changes: 57 additions & 0 deletions .github/workflows/build-wheels-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# From https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows
name: Build Linux Wheels

on:
pull_request:
paths:
- build/packaging/**
- .github/workflows/build-wheels-linux.yml
push:
branches:
- nightly
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate builds
# Release candidate tags look like: v1.11.0-rc1
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
- ciflow/binaries/*
workflow_dispatch:

jobs:
generate-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: linux
test-infra-repository: pytorch/test-infra
test-infra-ref: main
with-cuda: disabled
with-rocm: disabled

build:
needs: generate-matrix
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/executorch
pre-script: build/packaging/pre_build_script.sh
post-script: build/packaging/post_build_script.sh
smoke-test-script: build/packaging/smoke_test.py
package-name: executorch
name: ${{ matrix.repository }}
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
with:
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: ${{ matrix.pre-script }}
post-script: ${{ matrix.post-script }}
package-name: ${{ matrix.package-name }}
smoke-test-script: ${{ matrix.smoke-test-script }}
trigger-event: ${{ github.event_name }}
58 changes: 58 additions & 0 deletions .github/workflows/build-wheels-m1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# From https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows
name: Build M1 Wheels

on:
pull_request:
paths:
- build/packaging/**
- .github/workflows/build-wheels-m1.yml
push:
branches:
- nightly
- release/*
tags:
# NOTE: Binary build pipelines should only get triggered on release candidate builds
# Release candidate tags look like: v1.11.0-rc1
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
- ciflow/binaries/*
workflow_dispatch:

jobs:
generate-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: macos-arm64
test-infra-repository: pytorch/test-infra
test-infra-ref: main
with-cuda: disabled
with-rocm: disabled

build:
needs: generate-matrix
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/executorch
pre-script: build/packaging/pre_build_script.sh
post-script: build/packaging/post_build_script.sh
smoke-test-script: build/packaging/smoke_test.py
package-name: executorch
name: ${{ matrix.repository }}
uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
with:
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: ${{ matrix.pre-script }}
post-script: ${{ matrix.post-script }}
package-name: ${{ matrix.package-name }}
runner-type: macos-m1-stable
smoke-test-script: ${{ matrix.smoke-test-script }}
trigger-event: ${{ github.event_name }}
4 changes: 3 additions & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ jobs:
# build module for executorch.extension.pybindings.portable_lib
BUILD_TOOL=${{ matrix.build-tool }}
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python \
EXECUTORCH_BUILD_PYBIND=ON \
bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
# see if we can import the module successfully
python -c "from executorch.extension.pybindings import portable_lib; print('success!')"
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@
[submodule "backends/vulkan/third-party/Vulkan-Headers"]
path = backends/vulkan/third-party/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers
[submodule "third-party/lm-evaluation-harness"]
path = third-party/lm-evaluation-harness
url = https://github.com/EleutherAI/lm-evaluation-harness
branch = v0.4.1
24 changes: 18 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ endif()
# data into sections so they can be properly gc'd. -s: strip symbol.
# -fno-exceptions -fno-rtti: disables exceptions and runtime type.
set(CMAKE_CXX_FLAGS_RELEASE
"-O2 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti")
"-ffunction-sections -fdata-sections -fno-exceptions -fno-rtti")
if(NOT APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
endif()
Expand Down Expand Up @@ -206,6 +206,13 @@ else()
set(CMAKE_TOOLCHAIN_IOS OFF)
endif()

# Detect if an Android toolchain is set.
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*android\.toolchain\.cmake$")
set(CMAKE_TOOLCHAIN_ANDROID ON)
else()
set(CMAKE_TOOLCHAIN_ANDROID OFF)
endif()

# EXECUTORCH_BUILD_HOST_TARGETS: Option to control the building of host-only
# tools like `flatc`, along with example executables like `executor_runner` and
# libraries that it uses, like `gflags`. Disabling this can be helpful when
Expand Down Expand Up @@ -328,18 +335,17 @@ if(EXECUTORCH_BUILD_GTESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/googletest)
endif()

option(EXECUTORCH_BUILD_ANDROID_JNI "Build Android JNI" OFF)
if(EXECUTORCH_BUILD_ANDROID_JNI)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)
endif()

if(EXECUTORCH_BUILD_SDK)
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER
ON
CACHE BOOL "EXECUTORCH_BUILD_EXTENSION_DATA_LOADER" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/sdk)
endif()

if(EXECUTORCH_BUILD_EXTENSION_APPLE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/apple)
endif()

if(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
endif()
Expand All @@ -361,6 +367,12 @@ if(EXECUTORCH_BUILD_VULKAN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
endif()

option(EXECUTORCH_BUILD_ANDROID_JNI "Build Android JNI" OFF)
if(EXECUTORCH_BUILD_ANDROID_JNI)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples/models/llama2/runner)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)
endif()

option(EXECUTORCH_BUILD_QNN "Build the backends/qualcomm directory" OFF)
if(EXECUTORCH_BUILD_QNN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/qualcomm)
Expand Down
Loading

0 comments on commit c005dd2

Please sign in to comment.