ml-engineering
Skill này làm gì
Đưa ra các phương pháp và công thức thực tiễn để huấn luyện và phục vụ các mô hình AI lớn, từ chọn phần cứng đến phục hồi sau lỗi. Dành cho kỹ sư ML cần các đợt huấn luyện lớn hoàn thành đúng hạn và đúng ngân sách.
Khi nào nên dùng
- ✓Khi bạn cần chọn phần cứng và bộ lưu trữ để huấn luyện một mô hình lớn.
- ✓Khi một đợt huấn luyện chạy chậm, hết bộ nhớ hoặc tạo ra giá trị NaN.
- ✓Khi bạn cần kế hoạch lưu checkpoint và phục hồi cho các công việc huấn luyện dài.
Liên kết skill
https://github.com/stas00/ml-engineering/blob/master/skills/ml-engineering/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Đợt huấn luyện mô hình lớn của chúng tôi liên tục tạo ra loss NaN. Hãy giúp tôi tìm nguyên nhân và cách khôi phục.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill là một hướng dẫn cô đọng, rút ra từ một tài liệu mở dài, bao gồm benchmark, lập lịch công việc, tinh chỉnh bộ nhớ và thông lượng, cùng sự ổn định khi huấn luyện. Với mỗi vấn đề, nó chỉ đến phần liên quan, kèm script và benchmark khi có.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Đây có phải một sổ tay huấn luyện đầy đủ không?
Không. Đây là một mục lục cô đọng, và mỗi phần đều liên kết tới một chương đầy đủ hơn để tìm hiểu sâu.
Nó có bao gồm cả phục vụ mô hình không?
Có. Nó bao gồm cả huấn luyện lẫn phục vụ các mô hình lớn, kể cả hệ thống truy xuất và suy luận.
Hướng dẫn này đến từ đâu?
Từ một cuốn sách mở của Stas Bekman, dựa trên kinh nghiệm huấn luyện các mô hình lớn.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 20k
- Vị trí xếp hạng
- #10479
- Giấy phép
- CC-BY-SA-4.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.