Skip to content

fix(dspark): initialize and optimize the Markov lookup embedding as an embedding - #971

Open
fynnsu wants to merge 1 commit into
benchmark-measurementfrom
markov-head-init
Open

fix(dspark): initialize and optimize the Markov lookup embedding as an embedding#971
fynnsu wants to merge 1 commit into
benchmark-measurementfrom
markov-head-init

Conversation

@fynnsu

@fynnsu fynnsu commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Change the way we init the markov head and switch it to using the Adam optimizer. These should be better defaults for the embedding layer.

Tests

Not extensively validated, and change is primarily theoretical. More experimentation to follow.

Checklist

I have filled in:

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan/results, such as providing test command and pasting the results.
  • (Optional) The necessary documentation update.
  • I (a human) have written or reviewed the code in this pr to the best of my ability.

Stack created with GitHub Stacks CLIGive Feedback 💬

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ff10dfbe-ab65-4110-84bc-82372ab3dbb8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Merge Protections

🔴 1 of 1 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require approval from approved reviewers list 👀 reviews

🔴 Require approval from approved reviewers list

Waiting for any of

  • approved-reviews-by = dsikka
  • approved-reviews-by = fynnsu
  • approved-reviews-by = orestis-z
  • approved-reviews-by = rahul-tuli
  • approved-reviews-by = shanjiaz
This rule is failing.

All pull requests must have at least one approving review from a member of the approved reviewers list before merging.

  • any of:
    • approved-reviews-by = dsikka
    • approved-reviews-by = fynnsu
    • approved-reviews-by = orestis-z
    • approved-reviews-by = rahul-tuli
    • approved-reviews-by = shanjiaz

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown

The quality checks have failed. Please run make style and make quality under
the root directory to address the lint failures. You will need to install the
dev optional install to get the required linting packages:
https://github.com/vllm-project/speculators/blob/main/CONTRIBUTING.md

@speculatorsbot speculatorsbot 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.

The change is well-motivated: markov_w1 is an embedding lookup table and should be treated as one for both initialization and optimizer routing. Initializing with std=0.01 keeps the Markov sequential bias small at the start of training (the default N(0, 1) would let W1 @ W2 dominate the DFlash logits from step 1), and routing to AdamW follows the standard Muon convention for embedding layers.

The commit message states "Add tests for both: the Muon/AdamW split had no coverage," but the diff contains no test files. Are those tests in a separate PR in the stack, or were they inadvertently left out?

🤖 Generated with Claude Code using the /pr-review skill

@WindChimeRan WindChimeRan 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.

Theoretically this should be applied to both markov_w1 and markov_w2.

Please see my previous ablation study on why this is difficult.

#866.

We need more ablation study for this bug fix.

…n embedding

MarkovHead.markov_w1 indexes the verifier vocabulary, but it is stored as a
2D nn.Embedding weight, so two pieces of code treated it as an ordinary
matrix.

split_named_params_for_muon routed it to Muon's orthogonalized update. Muon
excludes embeddings and the output head by convention, since orthogonalizing
a lookup table updates every row of the vocabulary on a step where only a few
tokens appeared. Add markov_w1 to the AdamW name hints so it is grouped with
embed_tokens and lm_head.

It also kept nn.Embedding's default N(0, 1) initialization. markov_w2
projects the lookup straight onto the draft logits, so a unit-scale init lets
the sequential bias dominate the DFlash logits from the first step.
Initialize it with std=0.01.

Add tests for both: the Muon/AdamW split had no coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
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.

3 participants