Skip to content

Commit bd31977

Browse files
author
Guang Yang
committed
Move benchmark apps to extension/benchmark dir
1 parent 9c4032b commit bd31977

Some content is hidden

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

50 files changed

+80
-33
lines changed

.github/workflows/android-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ jobs:
292292
--output-dir benchmark-results \
293293
--repo ${{ github.repository }} \
294294
--head-branch ${{ github.head_ref || github.ref_name }} \
295-
--workflow-name ${{ github.workflow }} \
295+
--workflow-name "${{ github.workflow }}" \
296296
--workflow-run-id ${{ github.run_id }} \
297297
--workflow-run-attempt ${{ github.run_attempt }}
298298
done

.github/workflows/android.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- install_requirements.sh
1616
- examples/demo-apps/android/**
1717
- extension/android/**
18+
- extension/benchmark/android/**
1819
- extension/module/**
1920
workflow_dispatch:
2021

.github/workflows/apple-perf.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,17 @@ jobs:
235235
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
236236
build/build_apple_frameworks.sh --coreml --custom --mps --optimized --portable --quantized --xnnpack
237237
238-
mkdir -p extension/apple/Benchmark/Frameworks
238+
mkdir -p extension/benchmark/apple/Benchmark/Frameworks
239239
for FRAMEWORK in "${FRAMEWORKS[@]}"; do (
240-
cp -r "cmake-out/${FRAMEWORK}.xcframework" extension/apple/Benchmark/Frameworks/
240+
cp -r "cmake-out/${FRAMEWORK}.xcframework" extension/benchmark/apple/Benchmark/Frameworks/
241241
) done
242242
echo "::endgroup::"
243243
244244
# NB: Although exported models can be copied to this directory and bundled together with the
245245
# app, we don't use this in CI and rely on AWS extra data parameter to make the model and the
246246
# tokenizer available to the benchmark. This decouples the app and the model. We just need to
247247
# create the directory here to pass the build
248-
mkdir -p extension/apple/Benchmark/Models
248+
mkdir -p extension/benchmark/apple/Benchmark/Models
249249
${CONDA_RUN} --no-capture-output \
250250
build/build_apple_llm_demo.sh ${ARTIFACTS_DIR_NAME}
251251

.github/workflows/apple.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
- build/test_ios_ci.sh
1919
- examples/demo-apps/apple_ios/**
2020
- extension/apple/**
21+
- extension/benchmark/apple/**
2122
- extension/module/**
2223
workflow_dispatch:
2324

@@ -272,14 +273,14 @@ jobs:
272273
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
273274
build/build_apple_frameworks.sh --coreml --custom --mps --optimized --portable --quantized --xnnpack
274275
275-
mkdir -p extension/apple/Benchmark/Frameworks
276+
mkdir -p extension/benchmark/apple/Benchmark/Frameworks
276277
for FRAMEWORK in "${FRAMEWORKS[@]}"; do (
277-
cp -r "cmake-out/${FRAMEWORK}.xcframework" extension/apple/Benchmark/Frameworks/
278+
cp -r "cmake-out/${FRAMEWORK}.xcframework" extension/benchmark/apple/Benchmark/Frameworks/
278279
) done
279280
echo "::endgroup::"
280281
281282
echo "::group::Build ExecuTorch benchmark app"
282-
mkdir -p extension/apple/Benchmark/Models
283+
mkdir -p extension/benchmark/apple/Benchmark/Models
283284
${CONDA_RUN} --no-capture-output \
284285
build/build_apple_llm_demo.sh ${ARTIFACTS_DIR_NAME}
285286
echo "::endgroup::"

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
FILES_NEEDS_FORMAT=$(/opt/google-java-format -n extension/android/src/main/java/org/pytorch/executorch/*.java \
6767
examples/demo-apps/android/ExecuTorchDemo/app/src/main/java/com/example/executorchdemo/*.java \
6868
examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/*.java \
69-
extension/android/benchmark/app/src/main/java/org/pytorch/minibench/*.java)
69+
extension/benchmark/android/benchmark/app/src/main/java/org/pytorch/minibench/*.java)
7070
if [ -n "$FILES_NEEDS_FORMAT" ]; then
7171
echo "Warning: The following files need formatting. Please use google-java-format."
7272
echo "Use a binary from https://github.com/google/google-java-format/releases/"

.github/workflows/upload-android-test-specs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
pull_request:
55
paths:
66
- .github/workflows/upload-android-test-specs.yml
7-
- extension/android/benchmark/android-llm-device-farm-test-spec.yml
7+
- extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml
88
push:
99
branches:
1010
- main
1111
paths:
1212
- .github/workflows/upload-android-test-specs.yml
13-
- extension/android/benchmark/android-llm-device-farm-test-spec.yml
13+
- extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml
1414

1515
concurrency:
1616
# NB: This concurency group needs to be different than the one used in android-perf, otherwise
@@ -32,7 +32,7 @@ jobs:
3232
${{ github.repository }}/${{ github.run_id }}/artifacts
3333
retention-days: 1
3434
if-no-files-found: error
35-
path: extension/android/benchmark/android-llm-device-farm-test-spec.yml
35+
path: extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml
3636

3737
validate-android-test-spec:
3838
needs: upload-android-test-spec-for-validation
@@ -77,7 +77,7 @@ jobs:
7777
7878
- name: Upload the spec to S3 ossci-android bucket
7979
shell: bash
80-
working-directory: extension/android/benchmark/
80+
working-directory: extension/benchmark/android/benchmark/
8181
env:
8282
SPEC_FILE: android-llm-device-farm-test-spec.yml
8383
run: |

.github/workflows/upload-apple-test-specs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
pull_request:
55
paths:
66
- .github/workflows/upload-apple-test-specs.yml
7-
- examples/demo-apps/apple_ios/default-ios-device-farm-appium-test-spec.yml
7+
- extension/benchmark/apple/Benchmark/default-ios-device-farm-appium-test-spec.yml
88
push:
99
branches:
1010
- main
1111
paths:
1212
- .github/workflows/upload-apple-test-specs.yml
13-
- examples/demo-apps/apple_ios/default-ios-device-farm-appium-test-spec.yml
13+
- extension/benchmark/apple/Benchmark/default-ios-device-farm-appium-test-spec.yml
1414

1515
concurrency:
1616
# NB: This concurency group needs to be different than the one used in apple-perf, otherwise
@@ -32,7 +32,7 @@ jobs:
3232
${{ github.repository }}/${{ github.run_id }}/artifacts
3333
retention-days: 1
3434
if-no-files-found: error
35-
path: examples/demo-apps/apple_ios/default-ios-device-farm-appium-test-spec.yml
35+
path: extension/benchmark/apple/Benchmark/default-ios-device-farm-appium-test-spec.yml
3636

3737
validate-apple-test-spec:
3838
needs: upload-apple-test-spec-for-validation
@@ -78,7 +78,7 @@ jobs:
7878
7979
- name: Upload the spec to S3 ossci-ios bucket
8080
shell: bash
81-
working-directory: examples/demo-apps/apple_ios
81+
working-directory: extension/benchmark/apple/Benchmark/
8282
env:
8383
SPEC_FILE: default-ios-device-farm-appium-test-spec.yml
8484
run: |

build/build_android_llm_demo.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ build_android_demo_apps() {
108108
ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew build assembleAndroidTest
109109
popd
110110

111-
mkdir -p extension/android/benchmark/app/libs
112-
cp ${BUILD_AAR_DIR}/executorch.aar extension/android/benchmark/app/libs
113-
pushd extension/android/benchmark
111+
mkdir -p extension/benchmark/android/benchmark/app/libs
112+
cp ${BUILD_AAR_DIR}/executorch.aar extension/benchmark/android/benchmark/app/libs
113+
pushd extension/benchmark/android/benchmark
114114
ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew build assembleAndroidTest
115115
popd
116116
}
@@ -135,8 +135,8 @@ collect_artifacts_to_be_uploaded() {
135135
# Collect MiniBench APK
136136
MINIBENCH_APP_DIR="${ARTIFACTS_DIR_NAME}/minibench"
137137
mkdir -p "${MINIBENCH_APP_DIR}"
138-
cp extension/android/benchmark/app/build/outputs/apk/debug/*.apk "${MINIBENCH_APP_DIR}"
139-
cp extension/android/benchmark/app/build/outputs/apk/androidTest/debug/*.apk "${MINIBENCH_APP_DIR}"
138+
cp extension/benchmark/android/benchmark/app/build/outputs/apk/debug/*.apk "${MINIBENCH_APP_DIR}"
139+
cp extension/benchmark/android/benchmark/app/build/outputs/apk/androidTest/debug/*.apk "${MINIBENCH_APP_DIR}"
140140
}
141141

142142
BUILD_AAR_DIR="$(mktemp -d)"

build/build_apple_llm_demo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
set -euo pipefail
99

1010
ARTIFACTS_DIR_NAME="$1"
11-
APP_PATH="extension/apple/Benchmark/Benchmark"
11+
APP_PATH="extension/benchmark/apple/Benchmark/Benchmark"
1212

1313
xcodebuild build-for-testing \
1414
-project "${APP_PATH}.xcodeproj" \
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
AccessModifierOffset: -1
3+
AlignEscapedNewlinesLeft: true
4+
AlignTrailingComments: false
5+
AllowAllParametersOfDeclarationOnNextLine: true
6+
AllowShortIfStatementsOnASingleLine: false
7+
AllowShortLoopsOnASingleLine: false
8+
AlwaysBreakBeforeMultilineStrings: true
9+
AlwaysBreakTemplateDeclarations: true
10+
BinPackArguments: false
11+
BinPackParameters: false
12+
BreakBeforeBinaryOperators: false
13+
BreakBeforeBraces: Attach
14+
BreakConstructorInitializersBeforeComma: false
15+
ColumnLimit: 80
16+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
17+
ConstructorInitializerIndentWidth: 4
18+
ContinuationIndentWidth: 4
19+
Cpp11BracedListStyle: true
20+
DerivePointerAlignment: false
21+
ExperimentalAutoDetectBinPacking: true
22+
IndentCaseLabels: false
23+
IndentFunctionDeclarationAfterType: false
24+
IndentWidth: 2
25+
MaxEmptyLinesToKeep: 1
26+
NamespaceIndentation: None
27+
ObjCSpaceBeforeProtocolList: false
28+
PenaltyBreakBeforeFirstCallParameter: 10
29+
PenaltyBreakComment: 60
30+
PenaltyBreakFirstLessLess: 20
31+
PenaltyBreakString: 1000
32+
PenaltyExcessCharacter: 1000000
33+
PenaltyReturnTypeOnItsOwnLine: 200
34+
PointerAlignment: Right
35+
SpaceAfterControlStatementKeyword: true
36+
SpaceBeforeAssignmentOperators: true
37+
SpaceInEmptyParentheses: false
38+
SpacesBeforeTrailingComments: 1
39+
SpacesInAngles: false
40+
SpacesInCStyleCastParentheses: false
41+
SpacesInParentheses: false
42+
Standard: Cpp11
43+
TabWidth: 8
44+
UseTab: Never
45+
...

extension/apple/Benchmark/README.md renamed to extension/benchmark/apple/Benchmark/README.md

Lines changed: 8 additions & 8 deletions

extension/apple/Benchmark/Tests/Tests.xcconfig renamed to extension/benchmark/apple/Benchmark/Tests/Tests.xcconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
HEADER_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) \
2-
$(SRCROOT)/../../../.. \
2+
$(SRCROOT)/../../../../.. \
33
$(TEMP_DIR)/cmake/include
44

55
LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) \
@@ -16,7 +16,7 @@ OTHER_LDFLAGS[sdk=iphonesimulator*] = $(inherited) \
1616
-force_load $(BUILT_PRODUCTS_DIR)/libkernels_quantized-simulator-release.a
1717

1818
HEADER_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) \
19-
$(SRCROOT)/../../../.. \
19+
$(SRCROOT)/../../../../.. \
2020
$(TEMP_DIR)/cmake/include
2121

2222
LIBRARY_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) \
@@ -33,7 +33,7 @@ OTHER_LDFLAGS[sdk=iphoneos*] = $(inherited) \
3333
-force_load $(BUILT_PRODUCTS_DIR)/libkernels_quantized-ios-release.a
3434

3535
HEADER_SEARCH_PATHS[sdk=macos*] = $(inherited) \
36-
$(SRCROOT)/../../../.. \
36+
$(SRCROOT)/../../../../.. \
3737
$(TEMP_DIR)/cmake/include
3838

3939
LIBRARY_SEARCH_PATHS[sdk=macos*] = $(inherited) \

0 commit comments

Comments
 (0)