ml-engineering
できること
このスキルは、ハードウェアの選択から障害からの回復まで、大規模な AI モデルの学習と提供のための実用的な方法とレシピを提供します。大規模な学習を予定どおりかつ予算内で終わらせる必要がある ML エンジニア向けです。
使う場面
- ✓大規模モデルを学習させるためのハードウェアとストレージを選ぶ必要があるとき。
- ✓学習が遅い、メモリが不足する、または NaN の値を出すとき。
- ✓長い学習ジョブのためのチェックポイントと回復の計画が必要なとき。
スキルのリンク
https://github.com/stas00/ml-engineering/blob/master/skills/ml-engineering/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私たちの大規模モデルの学習で NaN の損失が出続けています。原因と回復の方法を一緒に考えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、長いオープンなリファレンスから抜き出された簡潔なガイドで、ベンチマーク、ジョブのスケジューリング、メモリとスループットの調整、学習の安定性を扱います。問題ごとに、該当する箇所を示し、スクリプトやベンチマークがあればそれも示します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Machine Learning Engineering
Distilled from Machine Learning Engineering Open Book by Stas Bekman - source: https://github.com/stas00/ml-engineering (CC BY-SA 4.0). Know-how from training BLOOM-176B, IDEFICS-80B and production RAG and RL training and inference systems. This skill is a condensed index; each section links back to the full chapter for depth, scripts, and benchmarks.
A field-tested, end-to-end guide to training and serving large models (LLMs, VLMs, multi-modal, RAG) on real hardware at scale - distilled from actually training BLOOM-176B and IDEFICS-80B and building production inference/RAG systems. It is a practitioner's brain dump: opinionated guidance backed by copy-paste scripts, benchmark tools, and comparison tables, written for the engineers and operators who have to make expensive clusters actually deliver a finished model.
It spans the entire stack that decides whether a run succeeds and how much it costs: selecting and benchmarking accelerators, storage, and network so the fast compute is never starved; orchestrating jobs with SLURM/Kubernetes; maximizing throughput (MFU) and fitting models in memory via parallelism (DP/TP/PP/ZeRO), activation recomputation, and offload; keeping training numerically stable through loss spikes and NaN/Inf; and surviving the inevitable hardware and job failures with frequent checkpointing, spare capacity, and automatic restarts. On the serving side it covers inference latency/throughput/cost trade-offs, KV-cache and memory sizing, and framework selection - plus diagnosing multi-node/multi-GPU hangs and testing the whole thing.
Use it as an operator's runbook: figure out which resource is actually the bottleneck (compute? memory? network? storage? dataloader?), then jump to the targeted recipe. For pure debugging technique (gdb/strace/py-spy/CUDA), pair this with The Art of Debugging.
Core principles
- Measure, don't assume. Vendor/theoretical TFLOPS are marketing; benchmark your hardware and software stack before optimizing or buying. Track MFU/throughput, not vibes.
- Find the actual bottleneck. A training step is gated by the slowest of: accelerator compute, memory bandwidth/capacity, inter/intra-node network, storage IO, or CPU dataloading. Optimizing anything else is wasted effort.
- At scale, failure is the steady state. With hundreds/thousands of accelerators, hardware will fail mid-run. Design for frequent checkpoints, automatic restarts, spare nodes, and kill/save switches from day one.
- Reproduce small and fast. Debug on a tiny model / few layers / one node before burning cluster time - see The Art of Debugging.
- Watch the logbooks. Others have already hit your instability; training chronicles document the loss spikes and the fixes. See LLM/VLM chronicles.
Compute / accelerators
Full chapter: Compute · Accelerators.
- The number that matters is achievable, not theoretical. Real matmul FLOPS are well below spec. Measure Maximum Achievable Matmul FLOPS with
mamf-finder.py; compute MFU (model FLOPS utilization) to compare setups. See the most important thing to understand and what accelerator characteristics we care for. For a full trial-node loop (compute + network + storage → markdown report) see How to evaluate the cluster and the evaluate-cluster skill. - Memory capacity + bandwidth often bind before FLOPS. Check the [accelerator memory size and speed table](https://github.com/stas00/ml-engineering/blob/master/compute/accelera
よくある質問
完全な学習マニュアルですか?
いいえ。簡潔な索引で、各セクションは、より深い内容のある完全な章にリンクしています。
モデルの提供についても扱いますか?
はい。検索と推論のシステムを含め、大規模モデルの学習と提供を扱います。
指針はどこから来ましたか?
Stas Bekman によるオープンな本からで、大規模モデルを学習させた経験に基づいています。
詳細
作者による元の説明
Field-tested methodology and concrete recipes for training and operating large-scale LLM/VLM/multi-modal models end to end - choosing and benchmarking accelerators, storage and network; SLURM/Kubernetes orchestration; maximizing training throughput and fitting models in memory; diagnosing and surviving training instabilities, NaN/Inf, and hardware/job failures; checkpointing and fault tolerance; inference performance and memory; debugging multi-node/ multi-GPU hangs; and writing/running tests. Use when the user is training or fine-tuning large models, hits low TFLOPS/MFU, OOM, slow dataloading
repo: stas00/ml-engineering
人気
- GitHubのスター
- 20k
- ランキング
- #10479
- ライセンス
- CC-BY-SA-4.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。