checkpoint-conversion
Download, validate, convert, classify, and merge LitGPT checkpoints while diagnosing model config, tokenizer, LoRA metadata, and checkpoint layout issues.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- checkpoint-conversion
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Download, validate, convert, classify, and merge LitGPT checkpoints while diagnosing model config, tokenizer, LoRA metadata, and checkpoint layout issues.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/checkpoint-layout.md4.9 KB
- 参考文档references/cli-reference.md6.7 KB
- 参考文档references/model-configs.md4.6 KB
- 参考文档references/troubleshooting.md7.2 KB
- 脚本scripts/check_checkpoint_layout.py11.7 KB
- 脚本scripts/check_lora_metadata.py9.8 KB
03 SKILL.md 正文
LitGPT Checkpoint Conversion
Use this sub-skill when the task involves checkpoint acquisition, LitGPT/Hugging Face format decisions, model configuration support, tokenizer/config layout, pre-flight validation, or LoRA merge readiness.
Route here when
- A checkpoint must be downloaded with
litgpt download, including gated Hub access, tokenizer-only downloads, or--model_nameoverrides for alternative weights. - A directory must be classified as LitGPT format, Hugging Face format, full/pretraining output, or LoRA output.
- A Hugging Face checkpoint needs
litgpt convert_to_litgpt, a LitGPT checkpoint needslitgpt convert_from_litgpt, or a pretraining checkpoint needslitgpt convert_pretrained_checkpoint. - A LoRA output must be checked or merged with
litgpt merge_lorabefore normal inference/evaluation/export. Config.from_name,Config.from_file,Config.from_checkpoint, orGPT(config)behavior matters for support triage.
Route generation/chat with a ready checkpoint to ../inference-chat/SKILL.md, training and LoRA creation to ../training-data/SKILL.md, and evaluation/serving flows to ../evaluation-serving/SKILL.md after using this sub-skill for layout checks.
Fast workflow
- Classify the directory with
python scripts/check_checkpoint_layout.py CHECKPOINT_DIR --json. - If it is Hugging Face format and lacks
lit_model.pth, convert it withlitgpt convert_to_litgpt CHECKPOINT_DIR --model_name MODEL_NAMEwhen the directory name is not a supported LitGPT config name. - If it is LitGPT format, run
litgpt validate CHECKPOINT_DIR --dtype float32before inference, training continuation, or evaluation. - If it is LoRA output, run
python scripts/check_lora_metadata.py CHECKPOINT_DIR --json; then runlitgpt merge_lora CHECKPOINT_DIRor add--pretrained_checkpoint_dir BASE_CHECKPOINT_DIRwhen metadata points to a moved base checkpoint. - If it is a LitGPT training/pretraining checkpoint with optimizer metadata, export model-only weights with
litgpt convert_pretrained_checkpoint CHECKPOINT_DIR OUTPUT_DIRbefore downstream loading. - If it must become Hugging Face-style output, ensure it has merged non-adapter weights, then run
litgpt convert_from_litgpt CHECKPOINT_DIR OUTPUT_DIR.
Bundled references
references/cli-reference.mdlists supported checkpoint subcommands, arguments, and safe sequencing.references/checkpoint-layout.mdexplains required files and classification signals.references/model-configs.mdexplains LitGPT model config lookup, support checks, and--model_nameoverrides.references/troubleshooting.mdmaps common errors to fixes.
Bundled scripts
scripts/check_checkpoint_layout.pyinspects files only; it does not load model weights, download files, or write outputs.scripts/check_lora_metadata.pyreadshyperparameters.yamlonly; it does not load LoRA/base weights or merge files.
Safety notes
- Treat downloads, conversions, and merges as potentially large I/O operations; ask before running them when runtime, network, or disk cost matters.
- Never expose access tokens in commands or notes; prefer
HF_TOKENor a secured environment mechanism. - Do not use
convert_from_litgpton LoRA or adapter checkpoints directly. Merge LoRA first; adapter checkpoint export is not supported by the converter.
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).