Skip to content

Commit 23fc5c1

Browse files
committed
Add arm64 size_test
1 parent 771588a commit 23fc5c1

File tree

2 files changed

+16
-43
lines changed

2 files changed

+16
-43
lines changed

.github/workflows/pull.yml

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -371,53 +371,28 @@ jobs:
371371
# see if we can import the module successfully
372372
python -c "from executorch.extension.pybindings import portable_lib; print('success!')"
373373
374-
test-binary-size-linux-gcc:
375-
name: test-binary-size-linux-gcc
376-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
377-
permissions:
378-
id-token: write
379-
contents: read
380-
strategy:
381-
fail-fast: false
382-
with:
383-
runner: linux.2xlarge
384-
docker-image: executorch-ubuntu-22.04-gcc9
385-
submodules: 'true'
386-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
387-
timeout: 90
388-
script: |
389-
# The generic Linux job chooses to use base env, not the one setup by the image
390-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
391-
conda activate "${CONDA_ENV}"
392-
393-
./install_requirements.sh --use-pt-pinned-commit
394-
# build module for executorch.extension.pybindings.portable_lib
395-
bash test/build_size_test.sh
396-
strip cmake-out/test/size_test
397-
output=$(ls -la cmake-out/test/size_test)
398-
arr=($output)
399-
size=${arr[4]}
400-
# threshold=48120 on devserver with gcc11.4
401-
# todo(lfq): update once binary size is below 50kb.
402-
threshold="51504"
403-
if [[ "$size" -le "$threshold" ]]; then
404-
echo "Success $size <= $threshold"
405-
else
406-
echo "Fail $size > $threshold"
407-
exit 1
408-
fi
409-
410374
test-binary-size-linux:
411375
name: test-binary-size-linux
412376
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
413377
permissions:
414378
id-token: write
415379
contents: read
416380
strategy:
381+
matrix:
382+
include:
383+
- runner: linux.2xlarge
384+
docker-image: executorch-ubuntu-22.04-gcc9
385+
threshold: 51504
386+
- runner: linux.2xlarge
387+
docker-image: executorch-ubuntu-22.04-clang12
388+
threshold: 51784
389+
- runner: linux.arm64.2xlarge
390+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
391+
threshold: 51784
417392
fail-fast: false
418393
with:
419-
runner: linux.2xlarge
420-
docker-image: executorch-ubuntu-22.04-clang12
394+
runner: ${{ matrix.runner }}
395+
docker-image: ${{ matrix.docker-image }}
421396
submodules: 'true'
422397
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
423398
timeout: 90
@@ -427,16 +402,13 @@ jobs:
427402
conda activate "${CONDA_ENV}"
428403
429404
./install_requirements.sh --use-pt-pinned-commit
430-
431405
# build module for executorch.extension.pybindings.portable_lib
432406
bash test/build_size_test.sh
433407
strip cmake-out/test/size_test
434408
output=$(ls -la cmake-out/test/size_test)
435409
arr=($output)
436410
size=${arr[4]}
437-
# threshold=48120 on devserver with gcc11.4
438-
# todo(lfq): update once binary size is below 50kb.
439-
threshold="51784"
411+
threshold="${{ matrix.threshold }}"
440412
if [[ "$size" -le "$threshold" ]]; then
441413
echo "Success $size <= $threshold"
442414
else

runtime/executor/pte_data_map.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ PteDataMap::get_data(const char* key) const {
3535
"Searching for key %s: NamedData at index %zu is null",
3636
key,
3737
i);
38-
if (strcmp(named_data_->Get(i)->key()->c_str(), key) == 0) {
38+
39+
if (named_data_->Get(i)->key()->string_view() == key) {
3940
// Get the segment index.
4041
size_t segment_index = named_data_->Get(i)->segment_index();
4142

0 commit comments

Comments
 (0)