Skip to content

Commit 1fb242c

Browse files
authored
Merge branch 'main' into modelLoadAndExecutionLogging
2 parents 895f03e + 9f6c0f2 commit 1fb242c

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

examples/models/llama/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ Note for Mac users: There's a known linking issue with Xcode 15.1. Refer to the
295295
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
296296
-DEXECUTORCH_BUILD_XNNPACK=ON \
297297
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
298+
-DSUPPORT_REGEX_LOOKAHEAD=ON
298299
-Bcmake-out/examples/models/llama \
299300
examples/models/llama
300301
@@ -353,6 +354,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
353354
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
354355
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
355356
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
357+
-DSUPPORT_REGEX_LOOKAHEAD=ON
356358
-Bcmake-out-android/examples/models/llama \
357359
examples/models/llama
358360

examples/models/llama/export_llama_lib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ def _prepare_for_llama_export(args) -> LLMEdgeManager:
719719
preq_mode=args.preq_mode,
720720
preq_group_size=args.preq_group_size,
721721
preq_embedding_quantize=args.preq_embedding_quantize,
722+
local_global_attention=args.local_global_attention,
722723
)
723724
)
724725

@@ -1447,7 +1448,7 @@ def _get_source_transforms( # noqa
14471448
transforms.append(
14481449
partial(
14491450
replace_kv_cache_with_ring_kv_cache,
1450-
layer_sizes=args.local_global_attention,
1451+
layer_sizes=local_global_attention,
14511452
)
14521453
)
14531454

examples/models/qwen3/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ cmake-out/examples/models/llama/llama_main
8686
```
8787

8888
To run the model on an example iOS or Android app, see the Llama README's [Step 5: Build Mobile apps](../llama/README.md#step-5-build-mobile-apps) section.
89+
90+
### FAQ
91+
For more help with exporting or running this model, feel free to ask in our [discord channel](https://lnkd.in/gWCM4ViK).

scripts/lint_urls.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
set -euo pipefail
99

10+
trap 'kill 0' SIGINT
11+
1012
status=0
1113
green='\e[1;32m'; red='\e[1;31m'; cyan='\e[1;36m'; yellow='\e[1;33m'; reset='\e[0m'
1214
user_agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
@@ -21,9 +23,11 @@ while IFS=: read -r filepath url; do
2123
(
2224
code=$(curl -k -gsLm30 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -I "$url") || code=000
2325
if [ "$code" -lt 200 ] || [ "$code" -ge 400 ]; then
26+
sleep 1
2427
code=$(curl -k -gsLm30 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -r 0-0 -A "$user_agent" "$url") || code=000
2528
fi
2629
if [ "$code" -lt 200 ] || [ "$code" -ge 400 ]; then
30+
sleep 1
2731
request_id=$(curl -sS -G -H 'Accept: application/json' \
2832
--data-urlencode "host=$url" \
2933
--data-urlencode "max_nodes=1" \
@@ -45,11 +49,16 @@ while IFS=: read -r filepath url; do
4549
done
4650
fi
4751
fi
52+
# Treat Cloudflare JS-challenge and rate-limit as success.
53+
if [[ "$code" == "403" || "$code" == "429" || "$code" == "503" ]]; then
54+
printf "${yellow}WARN %s${reset} ${cyan}%s${reset} %s\n" "$code" "$url" "$filepath"
55+
exit 0
56+
fi
4857
if [ "$code" -lt 200 ] || [ "$code" -ge 400 ]; then
49-
printf "${red}%s${reset} ${yellow}%s${reset} %s\n" "$code" "$url" "$filepath" >&2
58+
printf "${red}FAIL %s${reset} ${yellow}%s${reset} %s\n" "$code" "$url" "$filepath" >&2
5059
exit 1
5160
else
52-
printf "${green}%s${reset} ${cyan}%s${reset} %s\n" "$code" "$url" "$filepath"
61+
printf "${green} OK %s${reset} ${cyan}%s${reset} %s\n" "$code" "$url" "$filepath"
5362
exit 0
5463
fi
5564
) &
@@ -58,7 +67,7 @@ while IFS=: read -r filepath url; do
5867
sleep 1
5968
done
6069
done < <(
61-
pattern='(?!.*@lint-ignore)(?<!git\+)(?<!\$\{)https?://(?![^\s<>\")]*[<>\{\}\$])[^[:space:]<>")\[\]\\]+'
70+
pattern='(?!.*@lint-ignore)(?<!git\+)(?<!\$\{)https?://(?![^/]*@)(?![^\s<>\")]*[<>\{\}\$])[^[:space:]<>")\[\]\\|]+'
6271
excludes=(
6372
':(exclude,glob)**/.*'
6473
':(exclude,glob)**/*.lock'
@@ -77,6 +86,7 @@ while IFS=: read -r filepath url; do
7786
git --no-pager grep --no-color -I -P -o "$pattern" -- "${paths[@]}" "${excludes[@]}" \
7887
| sed -E 's/[^/[:alnum:]]+$//' \
7988
| grep -Ev '://(0\.0\.0\.0|127\.0\.0\.1|localhost)([:/])' \
89+
| grep -Ev '://[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' \
8090
| grep -Ev 'fwdproxy:8080' \
8191
|| true
8292
)

0 commit comments

Comments
 (0)