Repository navigation
Fix Riemannian gradient in Spel optimizer, add scaled Stiefel support - #301
Merged
Merged
Conversation
… to optimize on scaled Stiefel manifold Signed-off-by: Konstantin Golobokov <kogolobo@uw.edu>
Signed-off-by: Konstantin Golobokov <kogolobo@uw.edu>
Contributor
|
Signed-off-by: Konstantin Golobokov <kogolobo@uw.edu>
Signed-off-by: Konstantin Golobokov <kogolobo@uw.edu>
Spell optimizer, add scaled Stiefel supportSpel optimizer, add scaled Stiefel support
Signed-off-by: Konstantin Golobokov <kogolobo@uw.edu>
…o kogolobo/fix-spel
Contributor
|
@kogolobo can you update the copyright check |
Signed-off-by: Konstantin Golobokov <kogolobo@uw.edu>
mkhona-nvidia
approved these changes
Sep 21, 2026
Contributor
|
/ok to test bb2dd17 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the mathematical implementation of the SPEL (
Spel) optimizer (emerging_optimizers/orthogonalized_optimizers/spel.py) to align with Manifold Constrained Steepest Descent (arXiv:2601.21487) and adds configurable manifold scaling (scale_mode).Key Improvements
1. Tangent Space Projection on the Stiefel Manifold
In the previous implementation,
Speldid not overrideorthogonalize(). It passed the unconstrained ambient gradient directly to the inner Newton–Schulz step, effectively running Euclidean Muon followed by a post-hoc weight retraction.This PR implements the true Stiefel tangent space projection in
$$P_{T_W}(G) = G - \frac{1}{\sigma^2} W , \text{sym}(W^\top G) = G - \frac{1}{2\sigma^2} W (W^\top G + G^\top W)$$
orthogonalize()before applying the spectral LMO:This ensures the descent direction is strictly tangential to the manifold at the current iterate$W_t$ , fulfilling the Manifold Constrained Steepest Descent formulation.
2. Scaled Stiefel Manifold Support (
scale_mode)Added
scale_mode: SpelScaleT("unit_spectral_norm"|"unit_rms_to_rms_norm"):unit_spectral_norm(default): Standard Stiefel manifold constraint (unit_rms_to_rms_norm: Scaled Stiefel manifold whereBoth the tangent projection and the post-update retraction in$\sigma$ .
post_weight_update_fn_inplacecorrectly account forTesting & Verification
Tangent Space Verification (
test_tangent_space_projection):scale_modeoptions.Manifold Retraction Scaling (
test_post_update_produces_appropriately_scaled_orthogonal_weights):CI & Code Quality:
bash tests/ci/L0_Tests_CPU.shandbash tests/ci/L0_Tests_GPU.sh.uv run ruff check --fix .,uv run ruff format .).