(Phase 2)Add ModelOpt mixed FP8/NVFP4 support for image generation (#3570)
Signed-off-by: roG0d <baonudesifeizhai@gmail.com> Signed-off-by: baonudesifeizhai <85092850+baonudesifeizhai@users.noreply.github.com>
This commit is contained in:
1 parent
7d8816b46b
commit
076c34abfb
16 files changed
+768
-68
No files matched your search
@@ -138,11 +138,19 @@ def _normalize_quant_method_alias(method: str | None) -> str | None:
|
||||
|
||||
_MODEL_OPT_METHODS = {
|
||||
"modelopt",
|
||||
"modelopt_fp4",
|
||||
"modelopt_mixed",
|
||||
}
|
||||
_MODEL_OPT_FP8_ALGOS = {
|
||||
"FP8",
|
||||
"FP8_PER_CHANNEL_PER_TOKEN",
|
||||
}
|
||||
_MODEL_OPT_NVFP4_ALGOS = {
|
||||
"NVFP4",
|
||||
}
|
||||
_MODEL_OPT_MIXED_ALGOS = {
|
||||
"MIXED_PRECISION",
|
||||
}
|
||||
|
||||
|
||||
def _normalize_method_name(method: Any) -> str:
|
||||
@@ -170,6 +178,10 @@ def _detect_modelopt_method(config: Mapping[str, Any]) -> str | None:
|
||||
if quant_algo:
|
||||
if quant_algo in _MODEL_OPT_FP8_ALGOS:
|
||||
return "modelopt"
|
||||
if quant_algo in _MODEL_OPT_NVFP4_ALGOS:
|
||||
return "modelopt_fp4"
|
||||
if quant_algo in _MODEL_OPT_MIXED_ALGOS:
|
||||
return "modelopt_mixed"
|
||||
return None
|
||||
|
||||
if method is not None:
|
||||
|
||||
Reference in new issue
Block a user