租用 H100 的钱只需 233 美元。
☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 免费无限量使用 DeepSeek R1 模型☜☜☜



<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 save 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>
以上就是神级项目训练GPT-2仅需5分钟,Andrej Karpathy都点赞的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号