租用 H100 的钱只需 233 美元。
2 训练的项目「llm.c」曾经引发机器学习社区的热烈讨论。☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 免费无限量使用 DeepSeek R1 模型☜☜☜



10B tokens-->1B tokens 8xH100 上花 45 分钟训练 -->8xH100 上花 5 分钟训练
先进的架构:旋转嵌入、QK-Norm 和 ReLU^2; 新优化器:Muon; 嵌入中的 Untied Head; 投影和分类层初始化为零(muP-like); 架构 shortcut:值残差和嵌入 shortcut(部分遵循论文《Value Residual Learning For Alleviating Attention Concentration In Transformers》); 动量(Momentum)warmup; Tanh soft logit capping(遵循 Gemma 2); FlexAttention。
<section><code>pip install -r requirements.txt</code></section><section><code>pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu124 —upgrade # install torch 2.6.0</code></section><section><code>python data/cached_fineweb10B.py 10 # downloads only the first 1.0B training tokens to s*e time</code></section><section><code>./run.sh</code></section>
<section><code>sudo apt-get update</code></section><section><code>sudo apt-get install vim tmux python3-pip python-is-python3 -y</code></section><section><code>git clone <a href="https://www.php.cn/link/e8cb5f581442030021d62fd780fa674d" rel="nofollow" target="_blank" >https://www.php.cn/link/e8cb5f581442030021d62fd780fa674d</a></code></section><section><code>cd modded-nanogpt</code></section><section><code>tmux</code><code></code><code></code><code>pip install numpy==1.23.5 huggingface-hub tqdm</code></section><section><code>pip install --upgrade torch &</code></section><section><code>python data/cached_fineweb10B.py 18</code></section>
<section><code>sudo docker build -t modded-nanogpt .</code></section><section><code>sudo docker run -it --rm --gpus all -v $(pwd):/modded-nanogpt modded-nanogpt python data/cached_fineweb10B.py 18</code></section><section><code>sudo docker run -it --rm --gpus all -v $(pwd):/modded-nanogpt modded-nanogpt sh run.sh</code></section>



<section><code>@torch.compile</code></section><section><code>def zeroth_power_via_newtonschulz5 (G, steps=5, eps=1e-7):</code></section><section><code>assert len (G.shape) == 2</code></section><section><code>a, b, c = (3.4445, -4.7750,2.0315)</code></section><section><code>X = G.bfloat16 () / (G.norm () + eps)</code></section><section><code>if G.size (0) > G.size (1):</code></section><section><code>X = X.T</code></section><section><code> </code><code>for _ in range (steps):</code></section><section><code>A = X @ X.T</code></section><section><code>B = b * A + c * A @ A</code></section><section><code>X = a * X + B @ X</code></section><section><code>if G.size (0) > G.size (1):</code></section><section><code>X = X.T</code></section><section><code> </code><code> return X.to (G.dtype)</code></section>
内存使用量比 Adam 低 采样效率提高约 1.5 倍 挂钟开销小于 2%
在更新中使用 Nesterov 动量,在动量之后应用正交化。 使用特定的五次 Newton-Schulz 迭代作为正交化方法。 使用五次多项式的非收敛系数以最大化零处的斜率,从而最小化必要的 Newton-Schulz 迭代次数。事实证明,方差实际上并不那么重要,因此我们最终得到一个五次多项式,它在重复应用后(快速)收敛到 0.68、1.13 的范围,而不是到 1。 在 bfloat16 中运行 Newton-Schulz 迭代(而 Shampoo 实现通常依赖于在 fp32 或 fp64 中运行的逆 pth 根)。
以上就是神级项目训练GPT-2仅需5分钟,Andrej Karpathy都点赞的详细内容,更多请关注其它相关文章!
# 华纳
# 福州搜索优化讯息网站
# 网站优化友好链接优化
# 高邮英文网站推广
# 内江seo
# 京东商城营销推广力度
# 南宁seo前景如何
# 什么推广网站好点呢
# 如何优化网站应承易速达
# 运城seo优化作用
# 黄冈免费网站推广app
# 句话
# 五大
# 要在
# 产业
# 南极
# 只需
# 神技
# 训练器
# 迭代
# 仅需
# type
# follow
# ai
# 处理器
# docker
# git
# python
相关栏目:
【
企业资讯168 】
【
行业动态50218 】
【
媒体报道120512 】
相关推荐:
怎么在typescript写原型链
如何退出数据库命令行
苹果16系统有哪些系列
手机如何ip绑定域名解析
手机如何运行ping命令
固态硬盘颗粒如何修理
春运什么时候开始抢票
NoSQL数据库有哪些特点
冰柜power是什么意思这个黄灯怎么不亮
如何用dos命令分区
锤子手机怎么不出5g
哪些明星在用苹果16
充电器上的power是什么意思
为什么选择typescript
iphone拍电子屏有横条如何解决
苹果怎么没出5g手机
春运辅助抢票怎么抢
cos150度等于多少
夸克的答案为什么不对
三星固态硬盘如何保修
燃气热水器上的power是什么意思
夸克转存中是什么意思
夸克网盘是什么都有吗
win7怎么关闭360壁纸屏保
一分钟等于多少秒
nosql数据库的应用场景有哪些
datediff函数怎么用视频
光刻机分类有哪些品牌的
电脑type-c接口是什么意思
电焊机power灯亮是什么意思
如何看固态硬盘型号
硬盘和固态硬盘如何区分
typescript和node学哪个
360n6锁屏壁纸怎么设置
unix时间戳是什么意思
vue怎么连接typescript
春运抢票最快几天能成功
折叠屏有哪些手机
内网和外网区别 内网和外网有什么区别
debug中如何用n命令命名程序文件名
折叠屏手机选择哪个好
j*a数组怎么取元素
丰田type-c接口是什么
复制 命令如何撤销
折叠屏手机为什么这么小
如何测试固态硬盘速度
early什么意思
typescript怎么写call方法
交管12123协议头不完整怎么弄
三星 nfc什么功能是什么意思


