计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
low_rank_adapter_layer【效率与协作】Construct LoRA low-rank linear adapters and verify merged inference equivalence without relying on the original implementation repository.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when implementing or validating the LoRA layer mechanism from the paper. It is appropriate for linear, embedding-like, or projection-style weights where a frozen base matrix receives a trainable low-rank update. Do not use it to claim full benchmark recovery by itself; it only validates the adapter layer contract.
W0 with shape output by input.r, alpha scale, LoRA matrix A with shape rank by input, and B with shape output by rank.W0 x + (alpha/r) B A x.W0 + (alpha/r) B A and numerical merge-equivalence evidence.r * (input + output).A and B.alpha / r when rank is positive.B = 0 to confirm the initial model exactly matches the frozen pretrained model.Run python scripts/lora_math.py --input <fixture.json> or the included tests. The tests check zero-branch identity, trainable-parameter counting, and merged inference equivalence.
This skill uses deterministic matrix arithmetic and does not load PyTorch, Transformers, pretrained checkpoints, or the original LoRA repository.