Skip to content

5/5 support kimi 2.5 full + lora: LoRA base-weight CPU backup - #1223

Merged
yueming-yuan merged 1 commit into
radixark:mainfrom
nanjiangwill:kimi25-pr6-lora-cpu-backup
May 29, 2026
Merged

5/5 support kimi 2.5 full + lora: LoRA base-weight CPU backup#1223
yueming-yuan merged 1 commit into
radixark:mainfrom
nanjiangwill:kimi25-pr6-lora-cpu-backup

Conversation

@nanjiangwill

@nanjiangwill nanjiangwill commented May 26, 2026

Copy link
Copy Markdown
Contributor

Part 5/5 of splitting #1057 (Kimi K2.5 full-param + LoRA support) into reviewable PRs, rebased on latest main.

Add --lora-base-cpu-backup: with --colocate, keep a host-RAM mirror of the base weights in SGLang (enable_weights_cpu_backup) so they survive torch_memory_saver.pause() across rollout/training swaps, and have the trainer skip the per-step base weight sync (and the surrounding restore / re-quantize calls) entirely. Trades host RAM for faster onload/offload; ignored unless --colocate and LoRA are both on.

Stacks on #1222 (shared files: arguments.py, lora_utils.py, sglang_engine.py, update_weight_from_tensor.py). Until #1222 merges, the diff here also shows that PR's changes; review the last commit (perf: LoRA base-weight CPU backup) in isolation, or after #1222 lands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Kimi-K2.5 LoRA GRPO training, adding arguments for CPU backup of base weights and shared-outer grouped-expert LoRA. It optimizes weight syncing by skipping base weight transfers when CPU backup is enabled and updates target module mappings between Megatron and Hugging Face formats. The review feedback highlights three key issues: a potential IndexError when a pipeline parallel rank has no LoRA weights, a restrictive dotted-path check during module name conversion, and a potential AttributeError when accessing SGLang-specific arguments directly.

Comment thread miles/backends/megatron_utils/update_weight/update_weight_from_tensor.py Outdated
Comment thread miles/backends/megatron_utils/lora_utils.py
Comment thread miles/utils/arguments.py
@nanjiangwill nanjiangwill changed the title 6/6 support kimi 2.5 full + lora: LoRA base-weight CPU backup 5/5 support kimi 2.5 full + lora: LoRA base-weight CPU backup May 26, 2026

@yushengsu-thu yushengsu-thu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in this PR: #1057. So I approved to unblocked ci first.

@yueming-yuan
yueming-yuan changed the base branch from main to kimi25-pr5-shared-outer-lora May 28, 2026 03:04
@yueming-yuan
yueming-yuan changed the base branch from kimi25-pr5-shared-outer-lora to main May 28, 2026 03:14

@yueming-yuan yueming-yuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanjiangwill
nanjiangwill force-pushed the kimi25-pr6-lora-cpu-backup branch from df9ed15 to 39dd23a Compare May 28, 2026 23:47
@yueming-yuan
yueming-yuan merged commit cd84919 into radixark:main May 29, 2026
22 checks passed
@nanjiangwill
nanjiangwill deleted the kimi25-pr6-lora-cpu-backup branch May 29, 2026 00:19
Frankstein73 pushed a commit to sii-avalanche/miles that referenced this pull request Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants