[ET-VK][Adreno] Non-deterministic conv2d output for c_out in {168,176,184,192}; clean on Mali
Maintainer thường phản hồi trong vòng 1 ngày
@SS-JIA đang làm issue này rồi.
Từ ngày 24/8/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
🐛 Describe the bug
On Adreno, a single Conv2d lowered to the Vulkan delegate produces a different result on almost every execution, for a specific band of output channel counts. Identical .pte, identical input, same already-encoded command buffer replayed in one process.
Probe: Conv2d(48, c_out, 3, padding=1, bias=False) on a (1, 48, 64, 64) input, 200 in-process replays per run, order rotated across runs, cool device.
| c_out | excess distinct outputs | replays | runs with any deviation |
|---|---|---|---|
| 144 | 0 | 1600 | 0 / 8 |
| 160 | 0 | 1600 | 0 / 8 |
| 168 | 1142 | 1800 | 9 / 9 |
| 176 | 427 | 800 | 4 / 4 |
| 184 | 770 | 1000 | 5 / 5 |
| 192 | 772 | 1200 | 6 / 6 |
| 200 | 0 | 1400 | 0 / 7 |
| 224 | 0 | 600 | 0 / 3 |
Perfect separation. Every run of every c_out in {168, 176, 184, 192} deviates; no run of {144, 160, 200, 224} deviates across 5200 replays.
The band lies inside the im2col/GEMM convolution path: should_use_conv2d_im2col() routes any conv with c_out >= kIm2colMinCOut (128) there. Forcing that function to return false, so the direct conv2d shader is used, makes all of these deterministic. Note 160 and 200 are also in that path and are clean, so it is a size band inside the path, not the threshold itself.
This is very likely an Adreno driver or hardware problem, not an ExecuTorch bug
Three independent checks point away from ExecuTorch:
- A different GPU vendor is clean. The same binaries and the same
.ptefiles on a Galaxy S10+ (SM-G975F, Exynos 9820, Mali-G76, Android 12): all eightc_outvalues, 200 replays each, zero deviations. This is the strongest signal, becauseshould_use_conv2d_im2col()returnsgraph.device_is_mali() || c_out >= kIm2colMinCOut, so on Mali every conv takes the im2col path, including 144 and 160 which do not on Adreno. If the im2col shader itself were wrong, Mali should have been the worse device.
Confirmed at the application level as well, not just withexecutor_runner: a demo app built from the stock Vulkan backend runs both object detection (YOLO26) and image classification (EfficientNetV2-S) on the S10 with correct and stable results.
Separately, and worth knowing for anyone weighing the Vulkan delegate on Mali: on this S10 the Vulkan delegate is close to 2x slower than the XNNPACK equivalent for the same models. That is the opposite of the Adreno device, where Vulkan is clearly faster. The S10 is a 2019 part so this is not necessarily representative of current Mali hardware, but it does mean the delegate is fast on the GPU where it is incorrect and slow on the GPU where it is correct.
- Output is numerically correct on Mali, not merely stable. Exporting a Vulkan
.pteand a CPU.ptefrom the same model instance and comparing both against the eager reference gives 9.9e-07 (Vulkan) and 3.6e-07 (CPU), i.e. fp32 rounding. - Khronos synchronization validation reports zero hazards on the failing workload (layer injected into a debuggable app via
gpu_debug_layers, sync validation confirmed active by the layer's own settings message). NoSYNC-HAZARD, no VUID errors.
So the return false workaround most likely helps by avoiding whatever the Adreno driver miscompiles, rather than by avoiding an incorrect shader.
Reproducing
Counting distinct md5 of executor_runner stdout across repeated process launches is a poor measure: it is noisy, and on this device the failure rate of the related issue #21939 depends strongly on GPU power state. Patch executor_runner to dump outputs on every iteration of --num_executions (stock writes only the last), then count distinct outputs across in-process replays. This one is stable and reproduces at 215 to 262 MHz on a cool device, so unlike #21939 it is not sensitive to clock.
Possibly the same underlying defect as #21939, which is also Adreno-only but low-rate and power-state dependent.
Versions
ExecuTorch 1.4.1. Failing: Galaxy S26 Ultra (SM-S948B), Adreno 840v2. Clean: Galaxy S10+ (SM-G975F), Mali-G76.
- Ngôn ngữ chính
- Python
- Star
- 5.1k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 713
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytorch/executorch
-
Portable remainder kernel: wrong sign for integers and float64 rounded to floatCó thể đã có người làm @JakeStevens đã nhận 3 ngày trước. Đang mởbug module: kernels triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pytorch/executorch#23682 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triaged
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
pytorch/executorch#21640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug module: microcontrollers partner: arm
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
pytorch/executorch#23812 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[muse-glimmer] interpolate_pos_emb returns corrupted bf16 values on CPU and can segfaultCó thể đã có người làm @JakeStevens đã nhận 1 ngày trước. Đang mởbug module: examples triaged
pytorch/executorch#23797 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS Python wheel _portable_lib has non-relocatable libtorch rpathCó thể đã có người làm @JacobSzwejbka đã nhận 1 ngày trước. Đang mở
pytorch/executorch#23742 · 1 bình luận · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pytorch/executorch
Issue tương tự
-
area:core-platform effort:S priority:P3 status:in-review type:test
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 80/100
randomparity/kdive#3246 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
nf-core/metaboigniter#130 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
common-workflow-language/cwl-utils#477 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add dependabotĐang mởfeat
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
open-nudge/opentemplate#204 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limitCó thể đã có người làm @VascoSch92 đã nhận hôm nay. Đang mởpriority:medium ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenHands/extensions#781 ·
Maintainer thường phản hồi trong vòng 1 ngày