|
8 | 8 | # Build + run the WebGPU native test executables on Dawn (Tint) + SwiftShader. |
9 | 9 | # This is the substantive op-coverage gate: unlike the python operators suite |
10 | 10 | # (which only delegates add.Tensor to WebGPU, the rest CPU-fallback), these |
11 | | -# executables run rms_norm / multi-dispatch ordering / scratch through the real |
12 | | -# WebGPU backend on Dawn. |
| 11 | +# executables run quantized_linear / SDPA / update_cache / multi-dispatch |
| 12 | +# ordering / scratch through the real WebGPU backend on Dawn. (Simple ops — |
| 13 | +# add / rms_norm / the misc ops — run through the cases.py op-test framework.) |
13 | 14 | # |
14 | 15 | # Assumes the Dawn env is already sourced (Dawn_DIR + VK_ICD_FILENAMES + |
15 | 16 | # LD_LIBRARY_PATH) via .ci/scripts/setup-webgpu-linux-deps.sh. For local runs: |
16 | 17 | # source .ci/scripts/setup-webgpu-linux-deps.sh |
17 | 18 | # bash backends/webgpu/scripts/test_webgpu_native_ci.sh |
18 | 19 | # |
19 | 20 | # Builds whatever native test targets are present in the landed tree (NOT a fixed |
20 | | -# list). This stack lands: webgpu_native_test, webgpu_rms_norm_test (base) + |
21 | | -# webgpu_dispatch_order_test, webgpu_scratch_buffer_test (D107576199) + |
22 | | -# webgpu_update_cache_test (D107547307). SDPA executables join once they land. |
| 21 | +# list): webgpu_native_test (base) + webgpu_dispatch_order_test, |
| 22 | +# webgpu_scratch_buffer_test (D107576199) + webgpu_update_cache_test |
| 23 | +# (D107547307). SDPA executables join once they land. |
23 | 24 |
|
24 | 25 | set -e |
25 | 26 |
|
|
37 | 38 | cd "${EXECUTORCH_ROOT}" |
38 | 39 |
|
39 | 40 | # ── Exports for the model-driven executables (best-effort) ─────────────────── |
40 | | -# native_test + rms_norm + dispatch_order read .pte/golden inputs via env/dir and |
41 | | -# self-skip if absent; scratch is standalone (generates its own inputs). |
42 | | -PTE_MODEL="/tmp/webgpu_add_test.pte" |
43 | | -PTE_CHAINED_MODEL="/tmp/webgpu_chained_add_test.pte" |
44 | | -RMS_NORM_DIR="/tmp/rmsn" |
45 | | -RMS_NORM_OK=1 |
| 41 | +# native_test (quantized_linear/SDPA/update_cache) + dispatch_order read .pte/ |
| 42 | +# golden inputs via env/dir and self-skip if absent; scratch is standalone. |
| 43 | +# native_test itself is gated below on the executorch wheel being importable. |
46 | 44 | DISPATCH_ORDER_DIR="/tmp/dispatch_order" |
47 | 45 | DISPATCH_ORDER_OK=1 |
48 | 46 | UPDATE_CACHE_DIR="/tmp/update_cache" |
49 | 47 | UPDATE_CACHE_OK=1 |
50 | 48 |
|
51 | | -$PYTHON_EXECUTABLE -c " |
52 | | -from executorch.backends.webgpu.test.ops.add.test_add import export_add_model, export_chained_add_model |
53 | | -export_add_model('${PTE_MODEL}') |
54 | | -export_chained_add_model('${PTE_CHAINED_MODEL}') |
55 | | -" || echo "WARN: add export failed; webgpu_native_test self-skips models whose .pte is absent" |
56 | | - |
57 | 49 | $PYTHON_EXECUTABLE -c " |
58 | 50 | from executorch.backends.webgpu.test.ops.quantized_linear.test_quantized_linear import export_all_quantized_linear_models |
59 | 51 | export_all_quantized_linear_models('/tmp') |
60 | 52 | " || echo "WARN: q4gsw export failed; required configs will FAIL in webgpu_native_test" |
61 | 53 |
|
62 | | -$PYTHON_EXECUTABLE -c " |
63 | | -from executorch.backends.webgpu.test.ops.rms_norm.test_rms_norm import export_rms_norm_cases |
64 | | -export_rms_norm_cases('${RMS_NORM_DIR}') |
65 | | -" || { echo "WARN: rms_norm export failed; skipping rms_norm native test"; RMS_NORM_OK=0; } |
66 | | - |
67 | 54 | $PYTHON_EXECUTABLE -c " |
68 | 55 | from executorch.backends.webgpu.test.ops.dispatch_order.test_dispatch_order import export_dispatch_order_cases |
69 | 56 | export_dispatch_order_cases('${DISPATCH_ORDER_DIR}') |
@@ -112,7 +99,7 @@ cmake \ |
112 | 99 | "${EXECUTORCH_ROOT}" |
113 | 100 |
|
114 | 101 | # ── Build + run every native test target that exists in this tree ──────────── |
115 | | -TARGETS=(webgpu_native_test webgpu_rms_norm_test webgpu_dispatch_order_test webgpu_scratch_buffer_test webgpu_update_cache_test) |
| 102 | +TARGETS=(webgpu_native_test webgpu_dispatch_order_test webgpu_scratch_buffer_test webgpu_update_cache_test) |
116 | 103 | BIN_DIR="${BUILD_DIR}/backends/webgpu" |
117 | 104 |
|
118 | 105 | # Which targets are defined depends on which diffs are landed (native_test + |
@@ -141,20 +128,17 @@ for t in "${TARGETS[@]}"; do |
141 | 128 | done |
142 | 129 |
|
143 | 130 | echo "=== Run native tests on Dawn + SwiftShader ===" |
144 | | -# native_test is model-driven; only run it if the export produced its .pte |
145 | | -# (CI's setup-linux.sh provides the executorch wheel so exports succeed; a bare |
146 | | -# local run without the wheel self-skips here rather than hard-failing on load). |
147 | | -if [[ -x "${BIN_DIR}/webgpu_native_test" && -f "${PTE_MODEL}" ]]; then |
148 | | - env WEBGPU_TEST_MODEL="${PTE_MODEL}" \ |
149 | | - WEBGPU_TEST_CHAINED_MODEL="${PTE_CHAINED_MODEL}" \ |
150 | | - WEBGPU_TEST_SDPA_DIR=/tmp/ \ |
| 131 | +# webgpu_native_test hosts the quantized_linear / SDPA / update_cache / symint |
| 132 | +# sweeps. Gate on the executorch wheel being importable (the proxy for "the |
| 133 | +# exports above ran"): CI has the wheel so they ran; a bare local run without it |
| 134 | +# skips here rather than hard-failing the required-config guards. |
| 135 | +if [[ -x "${BIN_DIR}/webgpu_native_test" ]] && |
| 136 | + "${PYTHON_EXECUTABLE}" -c "import executorch" 2>/dev/null; then |
| 137 | + env WEBGPU_TEST_SDPA_DIR=/tmp/ \ |
151 | 138 | WEBGPU_TEST_QUANTIZED_LINEAR_DIR=/tmp/ \ |
152 | 139 | "${BIN_DIR}/webgpu_native_test" |
153 | 140 | else |
154 | | - echo "(skipping webgpu_native_test: no exported .pte — needs the executorch python wheel)" |
155 | | -fi |
156 | | -if [[ "${RMS_NORM_OK}" == "1" && -x "${BIN_DIR}/webgpu_rms_norm_test" ]]; then |
157 | | - "${BIN_DIR}/webgpu_rms_norm_test" "${RMS_NORM_DIR}" |
| 141 | + echo "(skipping webgpu_native_test: executorch wheel absent — exports did not run)" |
158 | 142 | fi |
159 | 143 | if [[ "${UPDATE_CACHE_OK}" == "1" && -x "${BIN_DIR}/webgpu_update_cache_test" ]]; then |
160 | 144 | "${BIN_DIR}/webgpu_update_cache_test" "${UPDATE_CACHE_DIR}" |
|
0 commit comments