Skip to content

Commit a936581

Browse files
author
Jorge Pineda
committed
Update on "[ET-VK] Introduce add_tensor overloads consuming TensorRef"
From ssjia: > we should always make sure to store references produced from `graph.get_val()` only after any calls to `graph.add_*()` (i.e. modifications to the values list) are made. This is because `graph.values_`, being a `std::vector`, will reallocate with more space and move its contents if the current allocation is not sufficient. This means that if you store a reference then call `graph.add_*()` then the underlying resource the reference points to may have been moved. I think we can guard against this behavior by passing a `TensorRef` directly, and never having to declare a variable `TensorRef& tref` in the caller's scope. An example is shown in `Staging.cpp`. We could have it consume `ValueRef` for brevity of the passing parameter but IMO it hinders readability. Differential Revision: [D55703483](https://our.internmc.facebook.com/intern/diff/D55703483/) [ghstack-poisoned]
2 parents 49d72c8 + 3fc8c65 commit a936581

File tree

144 files changed

+3750
-3414
lines changed

Some content is hidden

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

144 files changed

+3750
-3414
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a52b4e22571507abc35c2d47de138497190d2e0a
1+
0a038cf0cff2d071b7359ac0491fd2ba7798a438

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ EXPORTED_MODEL_NAME="${EXPORTED_MODEL_NAME}.pte"
118118
echo "Exporting ${EXPORTED_MODEL_NAME}"
119119
EXPORT_ARGS="-c stories110M.pt -p ${PARAMS} -d ${DTYPE} -n ${EXPORTED_MODEL_NAME}"
120120
if [[ "${MODE}" == "xnnpack" ]]; then
121-
EXPORT_ARGS="${EXPORT_ARGS} --pt2e_quantize xnnpack_dynamic"
121+
EXPORT_ARGS="${EXPORT_ARGS} -kv --use_sdpa_with_kv_cache -X -qmode 8da4w -G 128"
122122
fi
123123
$PYTHON_EXECUTABLE -m examples.models.llama2.export_llama ${EXPORT_ARGS}
124124

.github/workflows/_unittest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
# Setup MacOS dependencies as there is no Docker support on MacOS atm
3838
PYTHON_EXECUTABLE=python \
3939
EXECUTORCH_BUILD_PYBIND=ON \
40+
EXECUTORCH_BUILD_XNNPACK=ON \
4041
.ci/scripts/setup-linux.sh "${BUILD_TOOL}"
4142
4243
# Run pytest with coverage

.github/workflows/apple.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ jobs:
100100
zip -r "${RUNNER_TEMP}/artifacts/${FRAMEWORK}-${VERSION}.zip" "${FRAMEWORK}.xcframework"
101101
) done
102102
103+
# Build Debug iOS Frameworks
104+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
105+
build/build_apple_frameworks.sh --coreml --custom --mps --optimized --portable --quantized --xnnpack --Debug
106+
107+
# Bundle Debug iOS Frameworks
108+
for FRAMEWORK in "${FRAMEWORKS[@]}"; do (
109+
cd cmake-out && \
110+
mv "${FRAMEWORK}.xcframework" "${FRAMEWORK}_debug.xcframework" && \
111+
zip -r "${RUNNER_TEMP}/artifacts/${FRAMEWORK}_debug-${VERSION}.zip" "${FRAMEWORK}_debug.xcframework"
112+
) done
113+
103114
popd
104115
105116
upload-frameworks-ios:
@@ -146,5 +157,6 @@ jobs:
146157
147158
for FILENAME in "${RUNNER_TEMP}"/frameworks-ios/*.zip; do
148159
[ -e "${FILENAME}" ] || continue
160+
shasum -a 256 "${FILENAME}"
149161
${AWS_CMD} "${FILENAME}" s3://ossci-ios/executorch/ --acl public-read
150162
done

.github/workflows/pull.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ jobs:
232232
# build module for executorch.extension.pybindings.portable_lib
233233
BUILD_TOOL=${{ matrix.build-tool }}
234234
PYTHON_EXECUTABLE=python \
235+
EXECUTORCH_BUILD_XNNPACK=ON \
235236
EXECUTORCH_BUILD_PYBIND=ON \
236237
bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
237238

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
[submodule "third-party/flatcc"]
3838
path = third-party/flatcc
3939
url = https://github.com/dvidelabs/flatcc.git
40-
[submodule "examples/third-party/llama"]
41-
path = examples/third-party/llama
42-
url = https://github.com/facebookresearch/llama.git
4340
[submodule "examples/third-party/fbjni"]
4441
path = examples/third-party/fbjni
4542
url = https://github.com/facebookincubator/fbjni.git

.swift/coreml_backend_debug/dummy.swift

Whitespace-only changes.

.swift/custom_backend_debug/dummy.swift

Whitespace-only changes.

.swift/executorch_debug/dummy.swift

Whitespace-only changes.

.swift/mps_backend_debug/dummy.swift

Whitespace-only changes.

0 commit comments

Comments
 (0)