TFR tensor core with DSM drops an MXFP4/NVFP4 NaN block scale when its elements are masked
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
Línea de trabajo
Read hw/rtl/tcu/tfr/VX_tcu_tfr_mul_f4.sv at the two exception assignments identified in the issue, then compare the scale NaN handling in VX_tcu_tfr_mul_f8.sv. Reproduce with the listed tcu_fedp commands for --fmt=10 and --fmt=11; done means both return NaN for the masked NaN scale cases. Pull request #517 is already open for this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi there,
With VX_CFG_TCU_DSM_ENABLE, a NaN block scale (E8M0 0xFF for MXFP4, UE4M3 0x7F for NVFP4) no longer makes the result NaN when every element it scales has a zero operand. MXFP8 and MXBF8 do return NaN in that case (the fp8 multiplier raises the scale NaN for masked lanes since #460), and so do builds without DSM, SimX and the TfrFedp reference.
The FEDP unit test shows it on master 2221ee286 with the MX configuration of run-tcu-unit; --sparsity=100 zeroes A and clears the valid bits the way DSM does:
make -C hw/unittest/tcu_fedp NUM_REGS=2 SF=1 CONFIGS="-DSIMULATION -DSV_DPI -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_TYPE_TFR -DUSE_FEDP -DVX_CFG_TCU_MX_ENABLE -DVX_CFG_TCU_FP8_ENABLE -DVX_CFG_TCU_FP4_ENABLE -DVX_CFG_TCU_MXFP4_ENABLE -DVX_CFG_TCU_NVFP4_ENABLE"
./hw/unittest/tcu_fedp/tcu_fedp --fmt=10 --W=25 --ulp=0 --sfa=255 --sparsity=100 --no-trace
./hw/unittest/tcu_fedp/tcu_fedp --fmt=11 --W=25 --ulp=0 --sfa=127 --sparsity=100 --no-trace
Both fail at test 0 with expected=nan (0x7fc00000), actual=3.08809e+09 (0x4f38108d), which is C. --fmt=8 and --fmt=9 with the same options pass. The same happens with LANE_MASK=0, the core's setting. In a full WMMA run on rtlsim (NT=8, TFR, DSM), an MXFP4 or NVFP4 row of A that is all zero under NaN scales gives 0 in that row of C; without DSM, and on SimX, the row is NaN.
The cause is in hw/rtl/tcu/tfr/VX_tcu_tfr_mul_f4.sv, lines 262 and 523, which gate the scale NaN with the lane's valid bits (term_on = vld_mask):
assign exceptions_mxfp4[i].is_nan = ((sf_a == 8'hFF) || (sf_b == 8'hFF)) && (|term_on);
assign exceptions_nvfp4[i].is_nan = sf_nan && (|term_on);
Suggested fix: drop && (|term_on) (and the then unused term_on), as was done for sf_nan in VX_tcu_tfr_mul_f8.sv. Without DSM the mask is all ones, so default builds do not change. A PR follows.
Thanks!
- Lenguaje dominante
- Verilog
- Estrellas
- 2.4k
- Forks
- 563
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 71
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vortexgpgpu/vortex
-
RV64 signed DIV/REM restores the sign from bit 31Posiblemente ocupada @zzf2024 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
vortexgpgpu/vortex#501 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
fpu: sign-extend RV64 FCVT.WU positive overflow resultsPosiblemente ocupada @zzf2024 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
vortexgpgpu/vortex#499 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
WGMMA: the next kernel can compute with the previous kernel's B row left in the B buffer (rtlsim)Posiblemente ocupada @youzi27 la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vortexgpgpu/vortex#558 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
vortexgpgpu/vortex#521 ·
Los mantenedores suelen responder en 1 día
-
WGMMA: a block-major B tile can read K-major data left in the B buffer (rtlsim)Posiblemente ocupada @youzi27 la tomó hace 5 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vortexgpgpu/vortex#518 ·
Los mantenedores suelen responder en 1 día