[RFC]: add native float32 support for ML loss functions and activation primitives
Maintainer antworten meist innerhalb von 1 Tag
@AryanSharma48 arbeitet bereits daran.
Seit 25.10.2026.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 12/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c, javascript
- Bereich
- machine-learning, performance
Rechercherichtung
This is a tracking RFC, not a single task, so start by reading the existing float64 loss implementations under ml/base/loss/ and the float32 backlog in #649 to see how a float32 variant is laid out. The blocked activations (math/base/special/siluf, geluf, fast/gelu-tanhf, fast/gelu-quickf) depend on primitives such as erfcf and expitf that do not exist yet. Done means the team has agreed on the scope and each checklist package has its implementation, tests and benchmarks.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
This RFC proposes adding native single-precision (float32) support for the core machine learning loss functions and activation primitives.
Currently, the lack of float32 packages forces the engine to cast Float32Array buffers up to float64 to compute mathematical operations before casting back down. This doubles memory bandwidth usage and hinders SIMD vectorization. These proposed packages rely on standard algebraic arithmetic and can be efficiently implemented via single-precision C kernels without requiring new polynomial derivations.
Core ML Loss Functions (Forward & Gradients)
-
ml/base/loss/float32/epsilon-insensitive -
ml/base/loss/float32/epsilon-insensitive-gradient#16317 -
ml/base/loss/float32/hinge -
ml/base/loss/float32/hinge-gradient#16275 -
ml/base/loss/float32/huber -
ml/base/loss/float32/huber-gradient#16289 -
ml/base/loss/float32/log -
ml/base/loss/float32/log-gradient -
ml/base/loss/float32/modified-huber -
ml/base/loss/float32/modified-huber-gradient#16313 -
ml/base/loss/float32/squared-epsilon-insensitive -
ml/base/loss/float32/squared-epsilon-insensitive-gradient#16358 -
ml/base/loss/float32/squared-error -
ml/base/loss/float32/squared-error-gradient#16287 -
ml/base/loss/float32/squared-hinge -
ml/base/loss/float32/squared-hinge-gradient#16276
ML Activations
-
math/base/special/siluf -
math/base/special/geluf -
math/base/special/fast/gelu-tanhf -
math/base/special/fast/gelu-quickf
Prerequisites
The above ML pipeline relies on the following core single-precision math primitives, which are already being tracked in the #649:
-
math/base/special/erfcf(Required forgeluf) -
math/base/special/expitf(Required forsilufandgelu-tanhf) -
math/base/special/log1pexpf(Required forlogloss functions)
Related Issues
None.
Questions
None.
Other
No.
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 6k
- Forks
- 1.3k
- Ø Merge
- 1 T. 21 Std.
- Gemergte PRs (30 T.)
- 224
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- 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 stdlib-js/stdlib
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
stdlib-js/stdlib#16655 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Fix JavaScript lint errorsEvtl. vergeben @protestershankar hat das vor 6 Tagen übernommen. OffenGood First Issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
stdlib-js/stdlib#16563 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Fix C lint errorsEvtl. vergeben @raus7n hat das vor 14 Tagen übernommen. OffenGood First Issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
stdlib-js/stdlib#16454 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Fix JavaScript lint errorsEvtl. vergeben @Devansh-18155 hat das vor 39 Tagen übernommen. OffenGood First Issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
stdlib-js/stdlib#15970 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Fix JavaScript lint errorsEvtl. vergeben @lb1192176991-lab hat das vor 44 Tagen übernommen. OffenGood First Issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
stdlib-js/stdlib#15831 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in stdlib-js/stdlib
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 69/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
nearform/unbreakci#897 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
automation chore ci-cd consistency developer-experience difficulty: easy discoverability documentation enhancement github-actions good first issue help wanted hygiene priority: P3 seo shell yaml
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
swc-project/swc-next-issues#394 ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
githubnext/gh-aw-workshop#5790 ·
Maintainer antworten meist innerhalb von 1 Tag