[Diffusion] Add final-layout BF16 Host Weight Runtime artifacts (#6445)
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
3781214675
commit
493fc64397
13 files changed
+2949
-5
No files matched your search
@@ -0,0 +1,40 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
"""Model-owned declaration for complete final-layout tensor restoration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
FINAL_LAYOUT_TENSOR_MODEL_CONTRACT_SCHEMA = "vllm-omni.diffusion.final-layout-tensors-v1"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class FinalLayoutModelContract:
|
||||
"""Versioned model ABI for reconstruction from exact final-layout tensors."""
|
||||
|
||||
implementation_id: str
|
||||
version: str
|
||||
schema: str = FINAL_LAYOUT_TENSOR_MODEL_CONTRACT_SCHEMA
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
for name, value in (
|
||||
("schema", self.schema),
|
||||
("implementation_id", self.implementation_id),
|
||||
("version", self.version),
|
||||
):
|
||||
if not isinstance(value, str) or not value:
|
||||
raise ValueError(f"final-layout model contract {name} must not be empty")
|
||||
|
||||
def to_dict(self) -> dict[str, str]:
|
||||
return {
|
||||
"schema": self.schema,
|
||||
"implementation_id": self.implementation_id,
|
||||
"version": self.version,
|
||||
}
|
||||
|
||||
|
||||
__all__ = [
|
||||
"FINAL_LAYOUT_TENSOR_MODEL_CONTRACT_SCHEMA",
|
||||
"FinalLayoutModelContract",
|
||||
]
|
||||
Reference in new issue
Block a user