Skip to content

fix: Mooncake RDMA memory for aux_layers > 3#140

Merged
Dogacel merged 1 commit into
lightseekorg:mainfrom
Dogacel:various-fixes
Jul 3, 2026
Merged

fix: Mooncake RDMA memory for aux_layers > 3#140
Dogacel merged 1 commit into
lightseekorg:mainfrom
Dogacel:various-fixes

Conversation

@Dogacel

@Dogacel Dogacel commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator
  1. Mooncake assumed num_aux_layers to be 3, which causes OOM mid-training. Fixed it by parsing draft config properly.
  2. Support loading huggingface checkpoints into DCP format for warm startup.

Especially warm start helps us start directly from pre-trained hugging-face checkpoints, including DFlash checkpoint warm starting a DSpark model.

@Dogacel Dogacel marked this pull request as ready for review July 2, 2026 17:00
@Dogacel Dogacel requested a review from yubofredwang July 2, 2026 17:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52afe0c571

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread torchspec/config/mooncake_config.py Outdated
num_target_layers = getattr(draft_cfg, "num_target_layers", None)
if num_target_layers:
return int(num_target_layers)
aux_layers = getattr(args, "inference_aux_hidden_states_layers", None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use the flattened aux layer field

When users set inference.aux_hidden_states_layers in the YAML, config_to_flat_args exposes it as args.aux_hidden_states_layers, not args.inference_aux_hidden_states_layers. In configs whose draft config does not carry target_layer_ids/num_target_layers (for example standard Eagle3 configs with more than three explicit aux layers), this branch misses the user setting and falls back to 3, so the exported MOONCAKE_NUM_AUX_LAYERS and auto host/GPU buffer sizes remain too small and the same >3-layer Mooncake allocation failure can still occur.

Useful? React with 👍 / 👎.

Comment thread README.md
lightseek-bot
lightseek-bot previously approved these changes Jul 3, 2026
Signed-off-by: Doğaç Eldenk <dogacel@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8f09a49ca

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +116 to +121
target_layer_ids = getattr(draft_cfg, "target_layer_ids", None)
if target_layer_ids:
return len(target_layer_ids)
num_target_layers = getattr(draft_cfg, "num_target_layers", None)
if num_target_layers:
return int(num_target_layers)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor explicit aux layer overrides

In DFlash/DSpark runs where inference.aux_hidden_states_layers is set to override the draft config (for example, capturing more layers than the config's target_layer_ids), train_entry leaves that explicit list on args and the inference engines use it for capture, but this branch returns the draft config's length before looking at args.aux_hidden_states_layers. That sizes MOONCAKE_HOST_BUFFER_SIZE/GPU buffers and exports MOONCAKE_NUM_AUX_LAYERS for the wrong layer count, so the allocation failure this change is meant to fix can still occur; check the explicit aux layer list before falling back to the draft config.

Useful? React with 👍 / 👎.

@Dogacel Dogacel merged commit 63e31d5 into lightseekorg:main Jul 3, 2026
2 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