pretraining-and-deepspeed
Prepare and preflight Baichuan-7B pretraining corpora, tokenizer placement, DeepSpeed host/config files, launch command rendering, and checkpoint expectations without executing training.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- pretraining-and-deepspeed
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Prepare and preflight Baichuan-7B pretraining corpora, tokenizer placement, DeepSpeed host/config files, launch command rendering, and checkpoint expectations without executing training.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/configuration.md5.9 KB
- 参考文档references/troubleshooting.md7.2 KB
- 参考文档references/workflows.md6.6 KB
- 脚本scripts/render_deepspeed_command.py11.1 KB
- 脚本scripts/validate_training_inputs.py20.5 KB
03 SKILL.md 正文
Baichuan-7B Pretraining and DeepSpeed
Use this sub-skill when the task is about Baichuan-7B pretraining setup, corpus sharding, tokenizer.model placement, DeepSpeed JSON/hostfile validation, rendering the training launch command, checkpoint output expectations, or troubleshooting a failed training launch.
Do not use this sub-skill for C-Eval/MMLU benchmark execution or architecture-only inference. Route architecture and model internals questions to ../architecture-and-loading/; route shared package/API and install issues to the root skill's ../../references/api-reference.md and ../../references/troubleshooting.md.
Operating contract
- Treat the original
train.pyas a launch script, not an importable API. It parses arguments and initializes distributed DeepSpeed at module import time. - Use bundled helpers for safe preflight work:
scripts/validate_training_inputs.pychecks corpus, tokenizer, hostfile, DeepSpeed JSON, and checkpoint path layout.scripts/render_deepspeed_command.pyrenders adeepspeed ... train.py ...command without running it.
- Never execute DeepSpeed training unless the user explicitly asks to run it and provides suitable GPU/cluster resources, training data, tokenizer, and runtime environment.
- Keep full training claims bounded: bundled helpers validate inputs and render commands only; DeepSpeed training itself is not run by default.
Fast routing
| User intent | Read first | Action |
|---|---|---|
| "Prepare Baichuan pretraining data" | references/workflows.md |
Confirm UTF-8 shard files, shard count as a multiple of total ranks, and tokenizer placement; run validate_training_inputs.py. |
| "Validate DeepSpeed settings" | references/configuration.md |
Parse JSON and hostfile; check ZeRO/bf16/micro-batch expectations; report cluster/resource assumptions. |
| "Render/train command" | references/workflows.md |
Use render_deepspeed_command.py; show the command and warnings, do not launch by default. |
| "Where do checkpoints go?" | references/workflows.md |
Explain checkpoint_saving_path and Epoch-N tag expectations from model_engine.save_checkpoint(...). |
| "Training launch failed" | references/troubleshooting.md |
Match the symptom to missing tokenizer/data, malformed hostfile/config, dependency pins, or GPU/cluster issues. |
Required user inputs for preflight
Ask for or infer these paths from the user's active training workspace:
- Corpus directory, defaulting to
data_dirin the Baichuan demo. - SentencePiece tokenizer path, defaulting to
tokenizer.model. - DeepSpeed JSON config path, defaulting to
config/deepspeed.json. - DeepSpeed hostfile path, defaulting to
config/hostfile. - Training entrypoint path if rendering a command, commonly
train.pyin an active checkout or equivalent copied training script. - Checkpoint output directory, defaulting to
checkpoints. - Expected total rank count when the hostfile is unavailable.
Evidence distilled
This sub-skill is based on the Baichuan-7B training sections in the Chinese and English READMEs, train.py, config/deepspeed.json, config/hostfile, scripts/train.sh, and requirements.txt. Treat exact deepspeed==0.9.2, torch==2.0.0, transformers==4.29.1, xformers==0.0.20, and sentencepiece==0.1.97 compatibility as a runtime environment concern; the bundled helpers validate layout/configuration and do not prove a full GPU training launch.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).