[RFC]: add native float32 support for ML loss functions and activation primitives
维护者通常 1 天内回复
@AryanSharma48 已经在做这个了。
开始于 2026年10月25日。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 12/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c, javascript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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:.
- 主要语言
- JavaScript
- 星标
- 6k
- 派生
- 1.3k
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 224
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stdlib-js/stdlib 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
stdlib-js/stdlib#16655 · 1 条评论 ·
维护者通常 1 天内回复
-
Fix JavaScript lint errors可能已有人在做 @protestershankar 于 6 天前认领。 未关闭Good First Issue
难度 2/5 1-3 小时 新手友好度 82/100
stdlib-js/stdlib#16563 · 3 条评论 ·
维护者通常 1 天内回复
-
Fix C lint errors可能已有人在做 @raus7n 于 14 天前认领。 未关闭Good First Issue
难度 1/5 1 小时以内 新手友好度 82/100
stdlib-js/stdlib#16454 · 1 条评论 ·
维护者通常 1 天内回复
-
Fix JavaScript lint errors可能已有人在做 @Devansh-18155 于 39 天前认领。 未关闭Good First Issue
难度 1/5 1 小时以内 新手友好度 82/100
stdlib-js/stdlib#15970 · 1 条评论 ·
维护者通常 1 天内回复
-
Fix JavaScript lint errors可能已有人在做 @lb1192176991-lab 于 44 天前认领。 未关闭Good First Issue
难度 1/5 1 小时以内 新手友好度 90/100
stdlib-js/stdlib#15831 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 69/100
维护者通常 1 天内回复
-
bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 72/100
nearform/unbreakci#897 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
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
难度 1/5 1 小时以内 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
swc-project/swc-next-issues#394 ·
-
难度 1/5 1-3 小时 新手友好度 88/100
githubnext/gh-aw-workshop#5790 ·
维护者通常 1 天内回复