Skip to content

Commit 8f7363d

Browse files
committed
Update on "[ET-VK][8/n] Unsqueeze"
Exploit the fact that, we reduce the unsqueeze operation to permute. ``` torch.all(torch.permute(x.unsqueeze(0), [1, 0, 2, 3]) == x.unsqueeze(1)) torch.all(torch.permute(x.unsqueeze(0), [1, 2, 0, 3]) == x.unsqueeze(2)) torch.all(torch.permute(x.unsqueeze(0), [1, 2, 3, 0]) == x.unsqueeze(3)) ``` This diff introduce a minor change to the Permute implementation that it no longer requires the input dimension length to match the length of the permute array. This allows the `unsqueeze` operation to achieve a no-op `unsqueeze(0)` and then apply a permute. Differential Revision: [D56347734](https://our.internmc.facebook.com/intern/diff/D56347734/) [ghstack-poisoned]
2 parents 4fc0dfa + 2f082f7 commit 8f7363d

File tree

166 files changed

+4281
-2389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+4281
-2389
lines changed

.ci/docker/ci_commit_pins/pytorch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19f50333e91e9e8b20a78517becd74bca70c7d46
1+
b1984237a0fb32b760c1b84d6d02d2f0f7ed293b

.ci/docker/requirements-ci.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sympy==1.12
66
timm==0.6.13
77
tomli==2.0.1
88
torchsr==1.0.4
9-
transformers==4.36.0
9+
transformers==4.38.0
1010
zstd==1.5.5.1
1111
pytest==7.2.0
1212
pytest-cov==4.1.0

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# From https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2+
version: 2
3+
updates:
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
reviewers:
9+
- "pytorch/team-executorch"
10+
allow:
11+
- dependency-name: "torchfix"

.github/workflows/apple.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
timeout: 90
5959
script: |
6060
BUILD_TOOL=cmake
61-
VERSION="0.1.0"
61+
VERSION="latest"
6262
FRAMEWORKS=(
6363
"executorch"
6464
"coreml_backend"

.swift/custom_backend/dummy.swift

Whitespace-only changes.

.swift/custom_backend_debug/dummy.swift

Whitespace-only changes.

.swift/executorch/dummy.swift

Whitespace-only changes.

.swift/executorch_debug/dummy.swift

Whitespace-only changes.

.swift/mps_backend/dummy.swift

Whitespace-only changes.

.swift/mps_backend_debug/dummy.swift

Whitespace-only changes.

.swift/optimized_backend/dummy.swift

Whitespace-only changes.

.swift/optimized_backend_debug/dummy.swift

Whitespace-only changes.

.swift/portable_backend/dummy.swift

Whitespace-only changes.

.swift/portable_backend_debug/dummy.swift

Whitespace-only changes.

.swift/quantized_backend/dummy.swift

Whitespace-only changes.

.swift/quantized_backend_debug/dummy.swift

Whitespace-only changes.

.swift/xnnpack_backend/dummy.swift

Whitespace-only changes.

.swift/xnnpack_backend_debug/dummy.swift

Whitespace-only changes.

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,11 @@ if(EXECUTORCH_BUILD_PYBIND)
562562
list(APPEND _dep_libs custom_ops)
563563
endif()
564564

565+
if(EXECUTORCH_BUILD_QUANTIZED)
566+
target_link_options_shared_lib(quantized_ops_lib)
567+
list(APPEND _dep_libs quantized_kernels quantized_ops_lib)
568+
endif()
569+
565570
# TODO(larryliu): Fix macOS 2 dylibs having 2 sets of static variables issue
566571
if(EXECUTORCH_BUILD_CUSTOM_OPS_AOT AND NOT APPLE)
567572
list(APPEND _dep_libs custom_ops_aot_lib)
@@ -583,8 +588,11 @@ if(EXECUTORCH_BUILD_PYBIND)
583588

584589
# pybind portable_lib
585590
pybind11_add_module(portable_lib extension/pybindings/pybindings.cpp)
591+
# The actual output file needs a leading underscore so it can coexist with
592+
# portable_lib.py in the same python package.
593+
set_target_properties(portable_lib PROPERTIES OUTPUT_NAME "_portable_lib")
586594
target_compile_definitions(portable_lib
587-
PUBLIC EXECUTORCH_PYTHON_MODULE_NAME=portable_lib)
595+
PUBLIC EXECUTORCH_PYTHON_MODULE_NAME=_portable_lib)
588596
target_include_directories(portable_lib PRIVATE ${TORCH_INCLUDE_DIRS})
589597
target_compile_options(portable_lib PUBLIC ${_pybind_compile_options})
590598
target_link_libraries(portable_lib PUBLIC ${_dep_libs})

Package.swift

Lines changed: 0 additions & 101 deletions
This file was deleted.

backends/apple/coreml/scripts/install_requirements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rm -rf "$COREML_DIR_PATH/third-party"
2424
mkdir "$COREML_DIR_PATH/third-party"
2525

2626
echo "${green}ExecuTorch: Cloning coremltools."
27-
git clone "https://github.com/apple/coremltools.git" $COREMLTOOLS_DIR_PATH
27+
git clone --depth 1 --branch 7.2 "https://github.com/apple/coremltools.git" $COREMLTOOLS_DIR_PATH
2828
cd $COREMLTOOLS_DIR_PATH
2929

3030
STATUS=$?

backends/apple/mps/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ target_link_libraries(mpsdelegate
7777
${MPS_GRAPG_FRAMEWORK}
7878
)
7979

80+
target_link_options_shared_lib(mpsdelegate)
81+
target_compile_options(mpsdelegate PUBLIC ${_common_compile_options})
82+
8083
install(
8184
TARGETS mpsdelegate
8285
DESTINATION lib

0 commit comments

Comments
 (0)