Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
deployment【部署与运维】Route Baichuan2 quantization, CPU deployment, and Baichuan1-optimization checkpoint conversion.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task is about deploying Baichuan2 with smaller GPU memory, CPU-only loading, or checkpoint conversion for Baichuan 1-style optimization stacks.
Do not use this sub-skill for interactive chat UX, web/API serving, prompt formatting, or fine-tuning/LoRA. Route those requests to the sibling inference or fine-tuning sub-skills.
lm_head.weight.torch_dtype=torch.float16, omit device_map="auto", call model.quantize(4) or model.quantize(8), then move the quantized model to CUDA.device_map="auto", then save to a new directory for future reloads.model.quantize; it is useful for CPU-only correctness checks or very low-throughput runs, but is expected to be slow.lm_head.weight in a copied Baichuan2 checkpoint directory; do not overwrite the original checkpoint.scripts/quantize_model.py --dry-run --validate-imports ... prints the selected quantization plan without loading model weights.scripts/quantize_model.py --mode online --bits 4|8 ... performs the README-style online quantization route when CUDA is available.scripts/quantize_model.py --mode offline-8bit --save-dir ... saves an 8-bit quantized model directory.scripts/normalize_lm_head.py --dry-run --validate-key ... checks a single-file PyTorch checkpoint layout before writing anything.scripts/normalize_lm_head.py --input-dir ... --output-dir ... writes a normalized-lm_head checkpoint into a new directory.This sub-skill is anchored in the documented Baichuan2 quantization, CPU deployment, and Baichuan 1 migration snippets. Environment inspection also verified a CUDA-capable stack with Torch 2.5.1+cu121, Transformers 5.15.0, BitsAndBytes 0.50.1, a successful CUDA tensor smoke check, and a successful bitsandbytes.nn.Linear8bitLt forward smoke check.