Misc. bug: Hexagon: test-backend-ops POOL_2D fails for 128-wide kernels with padding on HTP0 (v73)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Inizia da ggml/src/ggml-hexagon/ ed esamina pool_pixel_boundary_vec, in particolare la maschera di predicato costruita con Q6_Q_vsetq_R; confrontala con Q6_Q_vsetq2_R e segui come pool_row_general_vec usa questo percorso. Esegui test-backend-ops -b HTP0 -o POOL_2D; il lavoro è completato quando tutti i 144 casi passano, inclusi i quattro casi con padding e kernel largo 128.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Name and Version
version: 1.0.0-dev (build 12536, commit 7a4117eef)
built with Clang 22.1.7 for Windows arm64
This is the unmodified master build where the bug reproduces. The bug is still present on current master (8af68d48); ggml/src/ggml-hexagon/ is identical between the two commits.
Operating systems
Windows
Which llama.cpp modules do you know to be affected?
Other (Please specify in the next section)
Command line
test-backend-ops -b HTP0 -o POOL_2D
Problem description & steps to reproduce
On my machine (Snapdragon X Elite X1E78100, Hexagon v73, SDK 6.7.0.0, driver 30.0.219.1000), test-backend-ops -b HTP0 -o POOL_2D fails 4 of the 144 cases. All four use a 128-wide kernel with padding; the other 140 pass, including the unpadded 128-wide kernels. The two shapes are ne_input=[259,5,3,2], k0=128, k1=3, s0=64, s1=2, p0=64, p1=1 and ne_input=[193,2,1,1], k0=128, k1=1, s0=128, s1=1, p0=128, p1=2, and each one fails for both avg and max pooling.
Avg pooling gives NMSE 294.16 and 206.38. Max pooling returns -FLT_MAX where the CPU reference is about 0.98. The mask in pool_pixel_boundary_vec is built per 32-float chunk. A full chunk has n = 32, so the code calls Q6_Q_vsetq_R(n * sizeof(float)) with 128 bytes. vsetq only takes a 7-bit byte count, so 128 wraps to 0 and the predicate is empty; Q6_V_vmux_QVV then substitutes the identity value (-FLT_MAX for max, 0 for avg) in every lane. Every output pixel that goes through this function with 32 or more valid columns therefore loses data, not only pixels with exactly 128. With stride 64 or 128, pool_row_general_vec sends every pixel, including interior ones, through this path; pixels with exactly 128 valid columns are just the most visible case (max gives -FLT_MAX), while the rest come out partly wrong. Q6_Q_vsetq2_R handles the full range and gives the correct mask, so switching to it is the whole fix.
Before the fix, 140 of 144 cases pass. After it, 144 of 144 pass on HTP0. POOL_1D is 240/240 both before and after. I only tested this on v73.
First Bad Commit
Likely 50569eb87 (ggml-org/llama.cpp#29995, which added the pool op). I did not bisect.
Relevant log output
Logs
before (7a4117eef):
[POOL_2D] ERR = 294.158129097 > 0.000000100 POOL_2D(pool_type=avg,type_input=f32,ne_input=[259,5,3,2],k0=128,k1=3,s0=64,s1=2,p0=64,p1=1): FAIL
[POOL_2D] ERR = 206.382433124 > 0.000000100 POOL_2D(pool_type=avg,type_input=f32,ne_input=[193,2,1,1],k0=128,k1=1,s0=128,s1=1,p0=128,p1=2): FAIL
[POOL_2D] inf mismatch: HTP0=-340282346638528859811704183484516925440.000000 CPU=0.985368 POOL_2D(pool_type=max,type_input=f32,ne_input=[259,5,3,2],k0=128,k1=3,s0=64,s1=2,p0=64,p1=1): FAIL
[POOL_2D] inf mismatch: HTP0=-340282346638528859811704183484516925440.000000 CPU=0.987192 POOL_2D(pool_type=max,type_input=f32,ne_input=[193,2,1,1],k0=128,k1=1,s0=128,s1=1,p0=128,p1=2): FAIL
after (51a77c4f2 + vsetq2):
POOL_2D(pool_type=avg,type_input=f32,ne_input=[259,5,3,2],k0=128,k1=3,s0=64,s1=2,p0=64,p1=1): OK
POOL_2D(pool_type=avg,type_input=f32,ne_input=[193,2,1,1],k0=128,k1=1,s0=128,s1=1,p0=128,p1=2): OK
POOL_2D(pool_type=max,type_input=f32,ne_input=[259,5,3,2],k0=128,k1=3,s0=64,s1=2,p0=64,p1=1): OK
POOL_2D(pool_type=max,type_input=f32,ne_input=[193,2,1,1],k0=128,k1=1,s0=128,s1=1,p0=128,p1=2): OK
- Lingua principale
- C++
- Stelle
- 136k
- Fork
- 25.7k
- Merge medio
- 2g 1h
- PR unite (30g)
- 524
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ggml-org/llama.cpp
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
bug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Llama chat webui. bug: scrollbar disappears when the mouse hovers near the top of the code blockForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ggml-org/llama.cpp#32465 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Eval bug: deepseek4 file with no ratio-4 (CSA) layer crashes with integer division by zero in the llama_kv_cache constructorForse già presa @rishitha2625 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ggml-org/llama.cpp#32424 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ggml-org/llama.cpp
Issue simili
-
[UBSan] spawn_simulator passes null child_options.args to uv_spawn (execvp nonnull violation)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
tenstorrent/tt-umd#4017 ·
I maintainer di solito rispondono entro 3 giorni
-
difficulty:easy func:gui prio:low type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NatronGitHub/Natron#1538 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hyprwm/hyprsunset#103 · 1 commento ·
-
Feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qbittorrent/qBittorrent#25338 ·
I maintainer di solito rispondono entro 2 giorni
-
Needs: Attention Needs: Version Info Platform: Android Platform: tvOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
react/react-native#60180 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni