-
Notifications
You must be signed in to change notification settings - Fork 45
Dion2 with shard-independent update route added #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@kwangjunahn please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This PR adds a shard_independent argument to the Dion2 optimizer, giving users control over how top-K row selection interacts with FSDP sharding.
1. Sharding-independent row selection for FSDP
Dion2 selects a subset of rows (top-K by L1 norm) for orthogonalization at each step. When parameters are sharded across devices, there's a design choice: should selection happen on local shards or on the full matrix?
Options
shard_independent=False(default)shard_independent=True2. Row-wise Selection Only
We now restrict Dion2's selection to row-wise selection (i.e.,
select_dim=-2). This ensures the selection semantics match "neuron-wise" selection, since linear layers have shape (output, input) — each row corresponds to one output neuron.Previously, the code would choose between row or column selection based on matrix shape or sharding configuration. This change makes the behavior more interpretable and consistent.