DistributedTaskIR API¶
DistributedTaskIR owns logical meshes, typed sharding, collective/P2P/local
task variants, distributed dependencies, and source lineage. Physical devices
and target implementation choices are forbidden here.
Logical distributed program over a virtual device mesh.
CollectiveParticipants
module-attribute
¶
CollectiveParticipants: TypeAlias = Annotated[tuple[int, ...], NON_EMPTY, UNIQUE_ITEMS, NON_NEGATIVE_ITEMS]
CollectiveSpecVariant
module-attribute
¶
TaskBodyVariant
module-attribute
¶
_DISTRIBUTED_RESERVED
module-attribute
¶
_DISTRIBUTED_RESERVED = frozenset({'model_spec', 'workload_spec', 'mapping_spec', 'inference_mapping_spec', 'inference_phase', 'batch_size', 'query_tokens', 'context_tokens', 'datatype', 'invocation', 'block_memory', 'scope', 'physical_device', 'device_id', 'route', 'queue', 'stream', 'kernel', 'implementation_id', 'start', 'start_time', 'end', 'end_time', 'duration', 'latency', 'bandwidth'})
__all__
module-attribute
¶
__all__ = ['AllGather', 'AllReduce', 'AllToAll', 'Broadcast', 'Collective', 'CollectiveKind', 'CollectiveSpec', 'CollectiveSpecVariant', 'Control', 'DistributedTask', 'DistributedTaskIR', 'DistributedValue', 'LocalCompute', 'LogicalMesh', 'MeshAxis', 'PeerTransfer', 'PointToPoint', 'ReductionKind', 'ReduceScatter', 'Reshard', 'ShardingSpec', 'TaskBody', 'TaskBodyVariant', 'collective_kind', 'make_collective_spec']
ValueConstraint ¶
Bases: Enum
Small closed vocabulary of reusable structural refinements.
VariantSpec
dataclass
¶
Manifest entry for one explicitly named ADT constructor.
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.
DistributedTaskSemantic ¶
Bases: SemanticPayload
Dialect semantics attached to a DistributedTaskIR 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.
TensorType ¶
Target-neutral logical tensor type.
ValueRole ¶
Bases: Enum
Semantic ownership role of a model-level SSA value.
MeshAxis ¶
One named dimension of the logical, target-neutral device mesh.
LogicalMesh ¶
Cartesian logical-rank space used by sharding and collectives.
ShardingSpec ¶
Mapping from tensor dimensions to logical mesh axes.
CollectiveKind ¶
Bases: Enum
Logical collective semantics independent of a communication library.
ReductionKind ¶
Bases: Enum
Associative reduction operation required by a logical collective.
CollectiveSpec ¶
Closed collective semantics without conditional reduction/root fields.
AllReduce ¶
Bases: CollectiveSpec
ReduceScatter ¶
Bases: CollectiveSpec
AllGather ¶
Bases: CollectiveSpec
AllToAll ¶
Bases: CollectiveSpec
Broadcast ¶
Bases: CollectiveSpec
PeerTransfer ¶
Logical point-to-point transfer between two virtual ranks.
TaskBody ¶
Closed family of mutually exclusive distributed task semantics.
LocalCompute ¶
Bases: TaskBody
Execute a target-neutral operation independently on the logical ranks.
Collective ¶
Bases: TaskBody
Task body carrying a well-formed logical collective specification.
PointToPoint ¶
Bases: TaskBody
Task body carrying one logical peer transfer.
Reshard ¶
Bases: TaskBody
Change logical ownership/sharding through explicit dataflow values.
Control ¶
Bases: TaskBody
Represent a dependency-only logical coordination task.
DistributedValue ¶
Model value specialized with logical ownership and sharding.
DistributedTask ¶
Common graph envelope around one typed distributed task body.
DistributedTaskIR ¶
Bases: CanonicalIRMixin
Logical task graph whose ranks are virtual, never physical devices.
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
collective_kind ¶
Source code in src/blueprinting/synthesizer/stages/distributed/ir.py
make_collective_spec ¶
make_collective_spec(kind: CollectiveKind, participants: tuple[int, ...], message_bytes: Scalar, *, reduction: ReductionKind | None = None, root: int | None = None) -> CollectiveSpecVariant
Boundary adapter from enum-oriented inputs into the canonical ADT.