intel / intel/auto-round

[Feature]: refine hardmard code

Open
#2,036 1 comment 0 reactions 1 assignee Claimed by @lkk12014402 View on GitHub
enhancement high priority
Dominant language
Python
Stars
1.6k
Forks
175
Avg merge
1d 18h
Merged PRs (30d)
99

Description

### Feature Description

I dont' know why code this init func like this

class RotationConfig(BaseModel, BaseRotationConfig):
"""Unified configuration for Hadamard rotation/transform applied to a model.

See the module docstring for a description of the three backends.

Notes:
* ``block_size`` is the group/block size for grouped Hadamard.
For ``backend="inplace"`` it is forwarded as ``group_size``
(``None`` / ``-1`` means full-dimension Hadamard).
"""

# Registry key consumed by BaseRotation.from_config (kept for API parity
# with other BaseRotationConfig subclasses).
algorithm: str = Field(default="hadamard", frozen=True)

# ---- shared ----
backend: str = Field(default="auto")
block_size: Optional[int] = Field(default=None)
hadamard_type: str = Field(default="hadamard")

# ---- inplace-only ----
fuse_online_to_weight: Optional[bool] = Field(default=None)
allow_online_rotation: bool = Field(default=True)

# for random hadamard (transform path)
random_seed: bool = Field(default=False, exclude=True)

model_config = {"arbitrary_types_allowed": True}

def __init__(self, **data: Any) -> None:

### Motivation and Use Case

~

### Alternatives Considered

~

### Definition of Done

_No response_

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.