support Per Group in Float8DynamicActivationFloat8WeightConfig (#4182)#4182
support Per Group in Float8DynamicActivationFloat8WeightConfig (#4182)#4182zlin888 wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4182
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 1695a45 with merge base 6f56403 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…ch#4182) Summary: as title Differential Revision: D97987011
6ba214d to
7d4ef7f
Compare
…ch#4182) Summary: Pull Request resolved: pytorch#4182 as title Differential Revision: D97987011
7d4ef7f to
9789cf8
Compare
…ch#4182) Summary: as title Differential Revision: D97987011
9789cf8 to
a0541b7
Compare
…ch#4182) Summary: Pull Request resolved: pytorch#4182 as title Differential Revision: D97987011
a0541b7 to
ac5bbb9
Compare
…ch#4182) Summary: as title Differential Revision: D97987011
ac5bbb9 to
cc4e17a
Compare
…ch#4182) Summary: Pull Request resolved: pytorch#4182 as title Differential Revision: D97987011
cc4e17a to
1695a45
Compare
|
@jerryzh168 @jcaip pls take a look. thanks! |
JiwaniZakir
left a comment
There was a problem hiding this comment.
In inference.py, logging.getLogger() (line added near the top) creates a root logger rather than a module-scoped one. The standard convention is logging.getLogger(__name__), which avoids accidentally affecting the logging behavior of unrelated modules that share the root logger.
Additionally, in _normalize_granularity and _check_hardware_support, the new is_per_group path checks that both granularities are PerGroup instances, but never validates that their group_size values match. A mismatch between activation and weight group sizes would likely produce silent incorrect results or a cryptic error downstream — an explicit check like granularity[0].group_size == granularity[1].group_size with a descriptive ValueError would catch this early.
Finally, the elif is_per_group branch in _check_hardware_support unconditionally emits a warning on every call. If this function is invoked repeatedly (e.g., per-layer during model conversion), this will flood logs. Emitting it once via warnings.warn(..., stacklevel=2) with stacklevel pointing to the caller, or using logger.warning with a rate-limiting approach, would be more user-friendly.
Summary:
as title
Differential Revision: D97987011