[Engine] strata-ink2: wrong logits in about 1 of 10 runs with the decode graph and the expert offload together (HIP, Windows)

Abierto
#7,333 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp

Línea de trabajo

Start with scripts/tokpath_repeat.sh and the logs token_path_hunt.txt and token_path_probe.txt to reproduce and inspect the failing decode runs. Compare decode graph plus expert offload against each mode disabled, then investigate the issue’s suspected table or pool data visibility across kernels and the named HIP graph switches. Done when repeated runs no longer produce incorrect logits with both features enabled.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

On an RX 7900 XTX (Windows 11, ROCm 10.2.0), strata-ink2 from feat/inkling2 (bb137fd8, plus the Windows build fix in baptisterajaut/Strata#17) sometimes gives wrong logits on the decode path. When it happens, the run is wrong from the first token on: KL 0.03 against a normal run at token 0, and top-1 agreement 8% over 100 tokens. The values stay finite, and the engine log looks exactly like a good run's.

How I see it

--kv i8r --tc 1 --vram-reserve-mib 1500 --chunk 0, 100 tokens, --dump-logits, compared byte for byte with a normal run (99% of the experts on the card):

decode graph expert offload runs wrong
on on 29 3
off (--graph 0) on 40 0
on off (no --vram-reserve-mib) 40 0

Both "off" modes give logits byte-identical to a normal run. The prompt path (--chunk 512) matched in 11 of 11 runs. So it seems to need the decode graph and the offload together. I haven't found the mechanism.

Ruled out: upload_embed copies the embedding with cudaMemcpyAsync from a vector that is freed right after, and HIP can read it late. That is a real race (fixed in baptisterajaut/Strata#23), but a build with that fix also gave a wrong run.

A guess, not checked: with the offload, k_cache_plan rewrites the expert tables (tabA / tabB) and k_fetch fills pool slots during the token, and the GEMVs read them in the next kernels. If HIP's optimized graph path launched those kernels without invalidating the per-CU caches, a GEMV could read a stale table entry or stale slot data. The runtime has switches I didn't try: DEBUG_HIP_GRAPH_CLASSIC_PATH, DEBUG_CLR_AQL_BARRIER_OPT.

Workaround: --graph 0. In this 100-token test it cost nothing measurable (1,158 ms median per 100 tokens, about 1,160 with the graph). I didn't measure it at long contexts.

Logs: token_path_hunt.txt and token_path_probe.txt; script: scripts/tokpath_repeat.sh. Not tested: Linux, CUDA, other cards.

Lenguaje dominante
C++
Estrellas
11.6k
Forks
1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Niko1221/Strata

Todos los issues de Niko1221/Strata

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.