Skip to content

Add causal LoRA adapter lifecycle - #40

Merged
chowhsu merged 1 commit into
mainfrom
feature/adapter-lifecycle
Aug 4, 2026
Merged

Add causal LoRA adapter lifecycle#40
chowhsu merged 1 commit into
mainfrom
feature/adapter-lifecycle

Conversation

@WaldenLee2005

Copy link
Copy Markdown
Contributor

Summary

  • Add strict LoRA adapter continuation with --resume-from and intentional training forks with --branch-from.
  • Add validated adapter staging for local and cloud artifacts, SHA-256 attestation, parent lineage, and recorded training recipes.
  • Add yeto merge for safe local adapter merges into an immutable base model with atomic, sharded SafeTensors output.
  • Document lifecycle semantics, safety checks, limitations, and operator workflows.

Behavior and safety

  • Strict resume requires the recorded base model, dataset identity, trust setting, and training recipe to match.
  • Branching permits deliberate recipe or data changes while preserving parent provenance.
  • Adapter continuation restores trainable LoRA weights but starts a fresh optimizer and scheduler; syncer checkpoints remain the crash-recovery mechanism.
  • Parent adapters must be SafeTensors LoRA artifacts for causal language models and must pass base-model, rank, alpha, digest, and symlink checks.
  • Cloud adapters require an explicit expected SHA-256 digest before GPU work begins.
  • Merge uses merge_and_unload(safe_merge=True), publishes atomically, records provenance, and supports configurable output shard size. Output sharding limits file size, not peak merge memory.

Validation

Automated

  • Post-rebase focused regression: 115 passed.
  • Pre-rebase non-MLX repository regression: 776 passed and 16 skipped; two log-sensitive syncer assertions also passed separately with the expected RUST_LOG=info setting.
  • Local MLX collection remains blocked by an unrelated fatal MLX import in the Mac environment.

H200 manual validation

  • SmolLM2 135M NF4 QLoRA: initial training, branch, strict resume, intentional drift rejection, tensor-change verification, merge, 24-shard SafeTensors export, provenance checks, reload, and generation all passed.
  • Qwen3.6 27B at revision 6a9e13bd6fc8f0983b9b99948120bc37f49c13e9: initial NF4 QLoRA, branch from sequence length 128 to 256, strict resume, lineage, all 992 adapter tensors changing, safe bf16 merge, 12 SafeTensors shards totaling 50.1 GiB, provenance, and merged-weight reload all passed on one H200.
  • Cached 27B generation exposed an incompatible optional causal_conv1d runtime fast path, not a merge or weight failure. Generation passed both with cache disabled and with the Transformers torch causal-convolution fallback forced. The production serving runtime should still be validated independently.

@chowhsu
chowhsu merged commit 92bf16f into main Aug 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants