[Bugfix] Initialize DeepGemmQuantScaleFMT oracle lazily; bound QuantFP8 UE8M0 packed path to group_size 128 (#51359)
Signed-off-by: BabyDrangoner <148877251+BabyDrangoner@users.noreply.github.com> Signed-off-by: kiroxu <148877251+BabyDrangoner@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
Wentao Ye
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
d20a031d33
commit
19d61b1273
+13
-2
@@ -84,9 +84,20 @@ class DeepGemmQuantScaleFMT(Enum):
|
||||
|
||||
@classmethod
|
||||
def from_oracle(cls) -> "DeepGemmQuantScaleFMT":
|
||||
"""Return the pre-initialized oracle decision"""
|
||||
"""Return the oracle decision, initializing it on first use.
|
||||
|
||||
The cache is normally populated by ``_lazy_init()`` (e.g. during
|
||||
engine startup), but standalone consumers such as ``QuantFP8`` with an
|
||||
explicit ``use_ue8m0=True`` can reach this before any DeepGEMM kernel
|
||||
wrapper has run. Resolve the DeepGEMM symbols and initialize the
|
||||
decision here instead of asserting; without DeepGEMM this yields
|
||||
FLOAT32, matching ``is_deep_gemm_e8m0_used()``.
|
||||
"""
|
||||
cached = getattr(cls, "_oracle_cache", None)
|
||||
assert cached is not None, "DeepGemmQuantScaleFMT oracle cache not initialized"
|
||||
if cached is None:
|
||||
_lazy_init()
|
||||
cls.init_oracle_cache()
|
||||
cached = cls._oracle_cache # type: ignore[attr-defined]
|
||||
return cached
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user