Skip to content

Change initial eigen values in KLShampoo to 1 - #310

Merged
skyw merged 2 commits into
mainfrom
skyw/update_klshampoo_initialization
Oct 16, 2026
Merged

skyw merged 2 commits into
mainfrom
skyw/update_klshampoo_initialization

Conversation

@skyw

@skyw skyw commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Hao Wu <skyw@nvidia.com>
@skyw
skyw requested a review from mkhona-nvidia October 14, 2026 18:05
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previously noted test gap is non-blocking.

Findings

  1. P2 First-step fix lacks a test ▶

Summary

KL-Shampoo now starts both eigenvalue vectors at one instead of zero.

  • KL-Shampoo starts its first factor update with unit eigenvalue weights.

Reviews (2) · Last reviewed commit: "grammar fix" · Reviewed by Greptile

Comment on lines +200 to +201
"eigvals_L": torch.ones(m, device=device),
"eigvals_R": torch.ones(n, device=device),

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.

P2 First-step fix lacks a test

The tests do not protect the behavior changed here. test_init_state_layout checks eigenvalue shapes but not their values. test_update_kronecker_factors_matches_legacy checks only a later update using the same helper. Returning to zero initialization could therefore pass both tests.

Add a first-step test with a rectangular gradient G, shampoo_beta=0, and small positive eps. Check that init_step produces L = G @ G.T / n and R = G.T @ G / m.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Signed-off-by: Hao Wu <skyw@nvidia.com>
@skyw

skyw commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ac6a500

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

/ok to test ac6a500

@skyw, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@skyw

skyw commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ac6a500

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

/ok to test ac6a500

@skyw, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@skyw

skyw commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 070a043

@github-actions

Copy link
Copy Markdown

Test Results

   99 files  ±0    200 suites  ±0   2m 11s ⏱️ -3s
1 586 tests ±0  1 586 ✅ ±0  0 💤 ±0  0 ❌ ±0 
3 811 runs  ±0  3 811 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 070a043. ± Comparison against base commit 4bbed19.

@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@skyw
skyw merged commit ad783b5 into main Oct 16, 2026
31 checks passed
@skyw
skyw deleted the skyw/update_klshampoo_initialization branch October 16, 2026 16:46

This branch was successfully deployed

2 active deployments
public — 070a043f Deployed Oct 14, 2026 by copy-pr-bot[bot] via release / finalize / notify #280
test — 070a043f Deployed Oct 14, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #1085
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.

1 participant