-
Notifications
You must be signed in to change notification settings - Fork 92
refine transform config api. #1607
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
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
faa014d
refine transform config api.
lkk12014402 00d248a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3842e33
Update auto_round/experimental/transform/helper.py
lkk12014402 f4ff447
Update auto_round/experimental/transform/helper.py
lkk12014402 1351df9
Update auto_round/experimental/transform/apply.py
lkk12014402 cb2624a
Update auto_round/experimental/transform/apply.py
lkk12014402 a5b72a1
Update auto_round/compressors/base.py
lkk12014402 351ea57
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 58da3d2
add more ut.
lkk12014402 79b7cf9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 76d2806
fix typo.
lkk12014402 e9cccd6
replace to .
lkk12014402 93ad904
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9982de6
fix typo
lkk12014402 90bb890
add initial hadamard tranform document.
lkk12014402 eb8b302
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 53c460a
update hadamard transform api for better usage.
lkk12014402 bde783f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 03d5bc4
fix typo
lkk12014402 b7ec9d7
update hadamard transform doc.
lkk12014402 c8d505b
format code.
lkk12014402 1e05744
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9d71ca6
update hadamard transform doc.
lkk12014402 52124fc
update doc.
lkk12014402 a6ca673
update doc.
lkk12014402 8a9347b
update doc.
lkk12014402 8a95b12
update doc.
lkk12014402 1ff5c34
Merge branch 'main' into refine_transform_api
lkk12014402 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # # Copyright (C) 2026 Intel Corporation | ||
| # # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from pydantic import BaseModel, Field, field_validator | ||
|
|
||
| __all__ = ["HadamardConfig"] | ||
|
|
||
|
|
||
| class HadamardConfig(BaseModel): | ||
| """ | ||
| Configuration of transforms to be applied to a model. This config is to be | ||
| serialized within a model's `config.json` file | ||
| """ | ||
|
|
||
| block_size: int = Field(default=32) | ||
|
|
||
| hadamard_type: str = Field(default="hadamard") | ||
|
|
||
| # for random hadamard transform | ||
| random_seed: bool = Field(default=False, exclude=True) | ||
|
|
||
| @field_validator("hadamard_type") | ||
| @classmethod | ||
| def validate_hadamard_type(cls, v: str) -> str: | ||
| allowed = {"hadamard", "random_hadamard"} | ||
| if v not in allowed: | ||
| raise ValueError(f"Unsupported hadamard_type: {v}. Supported values: {sorted(allowed)}") | ||
| return v |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.