[Engine] qsa_rows_bench: --ctx below 32768 makes the dense step read outside the page table (Xid 31)

Abierto Apto para principiantes
#6,209 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 5 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp
Área
testing

Línea de trabajo

Lee src/kernels/qsa_rows_bench.cpp alrededor de las líneas 138 y 207 para rastrear cómo se construyen el ancho de la ventana densa y los identificadores de celda. Reproduce el problema con qsa_rows_bench --rows --iters 100 --ctx 16384 --max-context 262144; verifica que la corrección mantenga el paso denso dentro del contexto y que la ejecución de 16K termine sin un acceso ilegal a memoria.

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

Descripción

Problem. qsa_rows_bench with a context under 32768 cells faults on the GPU. The dense step's window is fixed at
32768 cells, so at a shorter context its cell ids start below 0, and nothing bounds them.

Repro (RTX 5080, sm_120, driver 615.71.09, CUDA 13.3, Release build of the qsa_rows_bench target; the bench file is
identical to main):

qsa_rows_bench --rows --iters 100 --ctx 16384 --max-context 262144

Output, exit code 2:

qsa_rows_bench on device 0 (NVIDIA GeForce RTX 5080, 12.0), 100 iterations: context 16384, capacity 262144 cells (max_blocks 65538), selection cap 2051, int8 pools over 16452 cells
  selections: width 2051 a row; union of 2 rows 2360 cells (1.15x one row) union of 3 rows 2541 cells (1.24x one row) union of 4 rows 2608 cells (1.27x one row)
qsa_rows_bench: warm: an illegal memory access was encountered

Kernel log at the same moment:

NVRM: Xid (PCI:0000:01:00): 31, name=qsa_rows_bench, intr 00000000. MMU Fault: ENGINE GRAPHICS GPC6 GPCCLIENT_T1_5 faulted @ 0x220_cddf1000. Fault is of type FAULT_PDE ACCESS_TYPE_VIRT_READ

Cause (unconfirmed static analysis):

  • src/kernels/qsa_rows_bench.cpp:207 fills the dense window's ids as ctx + t + 1 - dense_win + j, with
    dense_win = 32768 (line 138).
  • At --ctx 16384 the first 16383 ids of each row are negative.
  • The batched decode attention reads p.page_table[cell / page_size] (src/kernels/cuda/qsa_decode_attn.cu:206, and
    418 and 618 in the other variants) with no lower bound, so the read lands before the page table.
  • The engine never passes negative ids, so the kernel itself is fine. The missing bounds check is in the bench.
  • The default --ctx 131072 and any context of 32768 or more stay in range.

Suggested fix: clamp the dense window to the context (min(dense_win, ctx + t + 1) cells a row, with the step
record's width to match), or skip the dense step when ctx + 1 < dense_win.

Validation:

  • Run: the 16K case above, once (it faulted).
  • Not run: 64K / 131K / 200K, --no-dense at 16K, and any fix. We will not run the bench again until it is fixed.

Measured and drafted with Claude Code.

Lenguaje dominante
C++
Estrellas
11.6k
Forks
1k
Merge medio
18 d 13 h
PR fusionados (30 d)
4

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.