Model L: propagate a NaN through enc0's ReLU + FP8 step as the original does; converter check for non-finite weight codes
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Bereich
- backend, machine-learning, testing
Rechercherichtung
Start with clean/l/reference/oracle.py and its _out_round relu_q8 mode, then compare the listed HIP and D3D12 kernels and the encoder block paths. Trace how the NaN-input case reaches the second linear and pack12 coefficients, and inspect clean/l/runner/l_hyb_stage_check.py for the separately reported leg. Done when the NaN cases match the oracle across implementations and the converter rejects non-finite weight codes with the stage and blob named.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
Model L's first input linear ends in a ReLU and an FP8 conversion: x1 = q8(max(0, RN16(b + W q))). When the
accumulator is NaN (a NaN input code in q, or a NaN weight code), the original keeps the NaN through the fused
ReLU + FP8 conversion. Our kernels give 0: max(0, NaN) returns 0 on the hardware and in the HIP code.
This affects every implementation of that step alike:
- main's kernels:
clean/l/kernels/l_ops.hip(linear_32_32<RELU = true>) and its D3D12 ports in
clean/dx12/kernels/l_ops_linear.hlsl(l_linear_32_32_relu,l_linear_32_32_fused, via
clean/dx12/hlsl/l_lin_px.hlsli); - the encoder block with the linears as its prologue (
clean/dx12/kernels/swin_block.hlslSW_SRC == 3,
clean/dx12/kernels/fused_swin.hlsl); - the hybrid twins of the same step (D3D12 and HIP).
The reference oracle (clean/l/reference/oracle.py, _out_round mode relu_q8) keeps the NaN, so the hybrid stage
check's random NaN-input cases differ from it (the second linear's chain and the pack12 coefficients downstream).
Finite inputs are unaffected.
Spec references: L P3 item 13; spec 05 edge cases. Spec 03 maps NaN inputs to 0, and real converted models contain no
FP8 NaN weight codes, so this is not visible on real data. It was kept out of 0.6.5.
Until it is fixed, the random-weight legs of clean/l/runner/l_hyb_stage_check.py draw finite codes only, and one
dedicated NaN-input leg is reported separately (listed, neither pass nor fail).
Proposed fix
- In every implementation listed above, make the ReLU + FP8 step keep a NaN as the original does (one form shared by
main's kernels, the hybrid twins and HIP, so the byte checks between them stay identical). - Fold the dedicated NaN-input leg back into the pass/fail random legs of
l_hyb_stage_check.pyonce the kernels
match the oracle.
Converter validation
Add a check to the model converter's validation: a real converted model must contain no non-finite weight codes (no FP8
NaN codes, no FP16 NaN or infinity in the converted blobs). A model that fails is refused with one line naming the stage
and blob.
Tests
l_hyb_stage_check.py: the NaN-input leg passes under the normal rule (then merged into the random legs).- The byte checks (HIP == D3D12) for the linears and the fused encoder block stay identical, NaN cases included.
- The converter check: one synthetic model with a NaN weight code is refused; the real models pass.
- Vorherrschende Sprache
- C++
- Sterne
- 12
- Forks
- 2
- Ø Merge
- 3 Std. 10 Min.
- Gemergte PRs (30 T.)
- 171
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus phantoslayer21/wronggpu
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
phantoslayer21/wronggpu#275 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
phantoslayer21/wronggpu#274 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
phantoslayer21/wronggpu#241 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug build
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
phantoslayer21/wronggpu#234 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug build
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
phantoslayer21/wronggpu#233 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in phantoslayer21/wronggpu
Ähnliche Issues
-
ai_p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
ClickHouse/ClickHouse#132519 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
juce-framework/JUCE#1810 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
petercorke/robotics-toolbox-python#952 ·
Maintainer antworten meist innerhalb von 1 Tag
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusOffenfunc:engine type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
NatronGitHub/Natron#1276 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag