Skip to content

[Transform] Hadamard Permutations #329

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

Merged
merged 42 commits into from
Jul 7, 2025
Merged

Conversation

kylesayrs
Copy link
Contributor

@kylesayrs kylesayrs commented May 30, 2025

Purpose

  • Rename TransformScheme.randomize_modules to TransformScheme.randomize to reflect the fact that weights assigned to different modules should still be randomized the same way (so that they can still cancel out)
  • Implement TransformScheme.randomize for hadamard matrices using permutations

Prerequisites

Changes

  • Add a permutations cache to HadamardFactory, keyed on weight (each unique model + weight combination gets its own permutation)
  • Modify tests to include testing schemes for which randomize_modules is True
  • Rename TransformScheme.randomize_modules to TransformScheme.randomize

Testing

  • Correctness and memory sharing tests continue to pass with new randomize_modules schemes

@kylesayrs kylesayrs changed the title [WIP] [Transform] Permutations [WIP] [Transform] Hadamard Permutations May 30, 2025
Signed-off-by: Kyle Sayers <[email protected]>
@kylesayrs kylesayrs force-pushed the kylesayrs/transform_permutations branch from 1ec9c0f to 8d613b3 Compare May 31, 2025 02:14
@kylesayrs kylesayrs changed the base branch from main to kylesayrs/transform_factory May 31, 2025 02:15
@kylesayrs kylesayrs marked this pull request as ready for review May 31, 2025 02:18
@kylesayrs kylesayrs changed the title [WIP] [Transform] Hadamard Permutations [Transform] Hadamard Permutations May 31, 2025
@kylesayrs kylesayrs self-assigned this May 31, 2025
Base automatically changed from kylesayrs/transform_factory to main June 10, 2025 15:24
@kylesayrs kylesayrs dismissed brian-dellabetta’s stale review June 10, 2025 15:24

The base branch was changed.

Copy link
Contributor

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

agree that randomize_modules sounds like randomization is done for each module, name change LGTM

dsikka
dsikka previously approved these changes Jul 3, 2025
Copy link
Collaborator

@dsikka dsikka left a comment

Choose a reason for hiding this comment

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

LGTM once conflicts are resolved

@kylesayrs kylesayrs dismissed stale reviews from dsikka and brian-dellabetta via 48653ec July 7, 2025 15:15
Signed-off-by: Kyle Sayers <[email protected]>
@kylesayrs kylesayrs merged commit f7e078f into main Jul 7, 2025
1 check passed
@kylesayrs kylesayrs deleted the kylesayrs/transform_permutations branch July 7, 2025 15:35
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