DSP tensor core: fp16 subnormal inputs are used at four times their value
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 1/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Ambito
- computer-graphics
Direzione di ricerca
Read hw/rtl/tcu/dsp/VX_tcu_fedp_dsp.sv at fp16_to_fp32, where the issue identifies the exponent calculation for subnormal inputs. Reproduce with the provided sgemm_tcu input change in tests/regression/sgemm_tcu/main.cpp and the ci/blackbox.sh rtlsim command; completion is shown when all 2046 subnormal codes convert correctly and the run passes. Pull request #512 is already open for this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi there,
With VX_CFG_TCU_TYPE_DSP, every fp16 subnormal operand of the tensor core is multiplied as if it were four times larger.
On master 2221ee286, give sgemm_tcu subnormals in row 0 of A, for example with this change to tests/regression/sgemm_tcu/main.cpp (after the loops that fill h_A and h_B):
for (uint32_t k = 0; k < K; ++k)
h_A[k] = uint16_t(1 + (k * 97) % 0x3ff); // fp16 subnormals, ITYPE=fp16 only
and run
CONFIGS="-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_TYPE_DSP -DITYPE=fp16 -DOTYPE=fp32" ./ci/blackbox.sh --driver=rtlsim --app=sgemm_tcu
rtlsim reports Found 64 / 4096 errors!, all of row 0 of C, e.g. expected=0.000873, actual=0.003491. simx passes, and so do the TFR and DPI types on rtlsim with the same data. A single product shows it directly: A = 0x0001 (2^-24) times B = 1.0 gives 0x34800000 (2^-22) instead of 0x33800000, and 0x03ff gives 2.44e-4, which is larger than the smallest normal 0x0400 (6.10e-5, converted correctly).
The cause is fp16_to_fp32 in hw/rtl/tcu/dsp/VX_tcu_fedp_dsp.sv:60:
is_denormal ? 8'd127 - 8'd14 - {3'b0, leading_zeros} + 8'd1 :
A subnormal 0.f x 2^-14 equals 1.f' x 2^(-15 - leading_zeros), so its biased fp32 exponent is 112 - leading_zeros; the code gives 114 - leading_zeros. The mantissa bits are already right. bf16 and the integer formats do not use this converter. On an FPGA build the converted value is a normal fp32 number, so the flush-to-zero of the vendor floating-point cores does not hide it.
Suggested fix: is_denormal ? 8'd112 - {3'b0, leading_zeros} :. With it, all 2046 fp16 subnormal codes convert exactly and the run above passes. A PR follows.
Thanks!
- Lingua principale
- Verilog
- Stelle
- 2.4k
- Fork
- 563
- Merge medio
- 1g 7h
- PR unite (30g)
- 71
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 vortexgpgpu/vortex
-
RV64 signed DIV/REM restores the sign from bit 31Forse già presa @zzf2024 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vortexgpgpu/vortex#501 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fpu: sign-extend RV64 FCVT.WU positive overflow resultsForse già presa @zzf2024 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
vortexgpgpu/vortex#499 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
WGMMA: the next kernel can compute with the previous kernel's B row left in the B buffer (rtlsim)Forse già presa @youzi27 l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
vortexgpgpu/vortex#558 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
vortexgpgpu/vortex#521 ·
I maintainer di solito rispondono entro 1 giorno
-
WGMMA: a block-major B tile can read K-major data left in the B buffer (rtlsim)Forse già presa @youzi27 l’ha presa 5 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
vortexgpgpu/vortex#518 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vortexgpgpu/vortex
Issue simili
-
bug ExecProducer triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
secondlife/viewer#6841 ·
I maintainer di solito rispondono entro 1 giorno
-
difficulty:easy func:viewer prio:normal type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NatronGitHub/Natron#2300 ·
I maintainer di solito rispondono entro 1 giorno
-
add_pads_bot places the component twiceForse già presa @Arka-noid l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
gdsfactory/gdsfactory#4971 ·
I maintainer di solito rispondono entro 2 giorni
-
needs-playtest slice
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Life-Framework/Life-Framework#6310 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
scenario-labs/skills#476 ·
I maintainer di solito rispondono entro 1 giorno