ModelIR API¶
ModelIR 表达模型 value、tensor type、显式数据流、operation、effect 和 dialect-owned semantic payload;不包含并行 placement、硬件吞吐或预测时间。
Hardware- and distribution-independent semantic model IR.
_MODEL_RESERVED
module-attribute
¶
_MODEL_RESERVED = frozenset({'model_spec', 'tp', 'pp', 'dp', 'rank', 'device', 'device_id', 'queue', 'kernel', 'implementation_id', 'start', 'start_time', 'end', 'end_time', 'duration', 'latency', 'memory_address', 'memory_offset'})
FrozenDict ¶
Bases: Mapping[str, V], Generic[V]
A compact, hashable mapping with recursively frozen values.
Source code in src/blueprinting/schema/frozen.py
__reduce__ ¶
Use the public constructor for process and UI cache round-trips.
DiagnosticBag ¶
VerificationReport
dataclass
¶
Bases: DiagnosticSet
Backward-compatible name for the domain-free immutable diagnostics.
Lineage ¶
Typed provenance from source entities to one lowering product.
ModelOperationSemantic ¶
Bases: SemanticPayload
Dialect semantics attached to a ModelIR operation.
CanonicalIRMixin ¶
Behavior shared by immutable canonical IR roots.
to_json ¶
Serialize through a self-describing, digest-checked envelope.
Source code in src/blueprinting/synthesizer/stages/common.py
from_json
classmethod
¶
Decode an exact-schema snapshot without exception control flow.
Source code in src/blueprinting/synthesizer/stages/common.py
require_from_json
classmethod
¶
Explicit exception adapter for trusted internal/replay boundaries.
Source code in src/blueprinting/synthesizer/stages/common.py
load_migrated
classmethod
¶
Load through an explicit registered migration path.
Source code in src/blueprinting/synthesizer/stages/common.py
verify ¶
Effect ¶
IRHeader ¶
Version and provenance header embedded in every canonical IR.
OperationName ¶
Structured operation identity; dialect is never inferred from a string.
SchemaVersion ¶
Semantic version of one serialized IR schema.
TensorType ¶
Target-neutral logical tensor type.
ValueRole ¶
Bases: Enum
Semantic ownership role of a model-level SSA value.
ModelValue ¶
One typed model-level SSA value with stable provenance.
ModelOperation ¶
One target-neutral operation with explicit dataflow and effects.
ModelIR ¶
Bases: CanonicalIRMixin
Explicit tensor SSA graph before distribution decisions.
enum ¶
Register one closed enumeration through the public authoring surface.
Source code in src/blueprinting/schema/deriving.py
record ¶
Derive an immutable canonical record from an annotated class declaration.
Source code in src/blueprinting/schema/deriving.py
is_known_target_dialect ¶
Recognize built-in target dialects forbidden before target binding.
make_header ¶
make_header(schema_name: str, schema_version: SchemaVersion, *, parent_digests: Iterable[str] = (), features: Iterable[str] = (), producer_version: str = '0.0.0') -> IRHeader
Source code in src/blueprinting/synthesizer/stages/common.py
reject_reserved_attributes ¶
reject_reserved_attributes(bag: DiagnosticBag, attributes: FrozenDict, reserved: frozenset[str], *path: str) -> None
Reject semantic fields smuggled through extension dictionaries.
Source code in src/blueprinting/synthesizer/stages/common.py
verify_known_references ¶
verify_known_references(bag: DiagnosticBag, references: Iterable[StableId], known: Iterable[StableId], *path: str) -> None
Source code in src/blueprinting/synthesizer/stages/common.py
verify_ordered_dag ¶
verify_ordered_dag(bag: DiagnosticBag, entities: Sequence[Entity], id_of: Callable[[Entity], StableId], dependencies_of: Callable[[Entity], Iterable[StableId]], path: str) -> None
Verify references and require canonical topological sequence order.
Source code in src/blueprinting/synthesizer/stages/common.py
verify_unique_ids ¶
verify_unique_ids(bag: DiagnosticBag, entities: Sequence[Entity], id_of: Callable[[Entity], StableId], path: str) -> None