PortablePlanIR API¶
PortablePlanIR is the target-neutral selected-strategy plan: exact work,
abstract buffers, capability requirements, objectives, and task DAG. Its
quantities are workload facts rather than latency estimates.
Target-neutral deployment plan IR.
Portable plans describe what resources and capabilities are required without choosing a physical device, queue, implementation, address, or timestamp.
PositiveFiniteFloat
module-attribute
¶
ImplementationAlternatives
module-attribute
¶
PlanTaskBodyVariant
module-attribute
¶
_PORTABLE_RESERVED
module-attribute
¶
_PORTABLE_RESERVED = frozenset({'model_spec', 'workload_spec', 'mapping_spec', 'inference_mapping_spec', 'inference_phase', 'batch_size', 'query_tokens', 'context_tokens', 'datatype', 'invocation', 'block_memory', 'scope', 'name', 'engine', 'phase', 'primitive', 'source_layer', 'collective', 'semantic', 'bound', 'target', 'target_id', 'physical_device', 'device_id', 'queue', 'queue_id', 'stream', 'engine_id', 'memory_bank', 'memory_address', 'memory_offset', 'implementation_id', 'kernel_id', 'start', 'start_time', 'end', 'end_time', 'duration', 'latency', 'estimated_time', 'peak_flops', 'peak_bandwidth'})
__all__
module-attribute
¶
__all__ = ['AbstractStorageClass', 'ImplementationRequirement', 'ObjectiveDirection', 'ObjectiveKind', 'PlanBuffer', 'PlanBufferRole', 'PlanObjective', 'PlanTask', 'PlanTaskBody', 'PlanTaskBodyVariant', 'ComputeTask', 'CollectiveTask', 'TransferTask', 'BarrierTask', 'HostTask', 'PlanTaskKind', 'PortablePlanIR', 'ResourceKind', 'ResourceRequirement', 'ResourceScope', 'WorkloadFacts']
ValueConstraint ¶
Bases: Enum
Small closed vocabulary of reusable structural refinements.
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.
ScalarExpr ¶
Bases: _ExpressionOperators
Closed family of exact scalar expression constructors.
Symbol ¶
Bases: _ExpressionOperators
Lineage ¶
Typed provenance from source entities to one lowering product.
BufferSemantic ¶
Bases: SemanticPayload
Typed semantic role attached to a portable buffer.
PlanTaskSemantic ¶
Bases: SemanticPayload
Dialect semantics attached to a PortablePlanIR task.
ProgramSemantic ¶
Bases: SemanticPayload
Dialect semantics shared by one canonical program snapshot.
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.
ResourceKind ¶
Bases: Enum
Target-neutral class of a resource demand.
ResourceScope ¶
Bases: Enum
Replication scope used when accounting a resource demand.
ResourceRequirement ¶
A typed, target-neutral quantity and its required capabilities.
ImplementationRequirement ¶
Target-neutral capability request with semantic alternatives.
WorkloadFacts ¶
Exact or symbolic work quantities, never performance estimates.
PlanBufferRole ¶
Bases: Enum
Semantic lifetime role of a portable buffer.
AbstractStorageClass ¶
Bases: Enum
Storage capability required without selecting a physical memory.
PlanBuffer ¶
A target-neutral buffer with exact size, lifetime links, and lineage.
PlanTaskKind ¶
Bases: Enum
Execution-domain category of a portable task.
PlanTaskBody ¶
Closed execution-domain semantics for one portable task.
ComputeTask ¶
Bases: PlanTaskBody
CollectiveTask ¶
Bases: PlanTaskBody
TransferTask ¶
Bases: PlanTaskBody
BarrierTask ¶
Bases: PlanTaskBody
HostTask ¶
Bases: PlanTaskBody
PlanTask ¶
A target-neutral unit of exact work in the selected strategy DAG.
ObjectiveKind ¶
Bases: Enum
Quantity optimized while exploring portable plans.
ObjectiveDirection ¶
Bases: Enum
Optimization direction for a portable-plan objective.
PlanObjective ¶
A weighted objective retained as search intent, not measured evidence.
PortablePlanIR ¶
Bases: CanonicalIRMixin
One target-neutral plan candidate with explicit dependency and buffer DAGs.
adt ¶
Declare the shared semantic wire namespace for a closed sum type.
Source code in src/blueprinting/schema/deriving.py
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
seal_adt ¶
Declare the explicit runtime closure corresponding to a static Union alias.
Source code in src/blueprinting/schema/deriving.py
variant ¶
Derive and register one explicitly named constructor of an ADT family.
Source code in src/blueprinting/schema/deriving.py
is_content_digest ¶
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_nonnegative_scalar ¶
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
Source code in src/blueprinting/synthesizer/stages/common.py
require_concrete_quantity ¶
Return a bound non-negative integer workload quantity.
Canonical portable plans may carry symbolic quantities before all workload bindings are available. Consumers that execute or cost a plan must cross this explicit gate instead of relying on truthiness or implicit numeric coercion.