fhelium.ir.dialects.distributed
Rank-local structured operations for SPMD collective execution.
Programs refer to launch-bound process groups and observe the current group rank without owning process-group lifecycle. Collective operations describe only one rank's local operand and result. Their local verifiers do not prove cross-rank ordering, uniform control flow, associativity, or deadlock freedom.
AllReduceAddCiphertextOp
class View source
AllReduceAddCiphertextOp(value: SSAValue | Operation, group: SSAValue | Operation, *, parameters: tuple[SSAValue | Operation, ...]=(), result_type: Attribute | None=None, attributes: Mapping[str, Attribute] | None=None)Bases: IRDLOperation
Reduce ciphertexts across a group using rank-local CKKS addition.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.all_reduce_add_ciphertext' | |
value | operand_def(CiphertextType) | |
group | operand_def(GroupType) | |
parameters | var_operand_def() | |
result | result_def(CiphertextType) |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
verify_
method
def verify_() -> None: ...AllReduceOp
class View source
AllReduceOp(value: SSAValue | Operation, group: SSAValue | Operation, combine: Region | Block, *, result_type: Attribute | None=None, attributes: Mapping[str, Attribute] | None=None)Bases: IRDLOperation
Reduce one local value across a group with a visible combine region.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.all_reduce' | |
value | operand_def() | |
group | operand_def(GroupType) | |
result | result_def() | |
combine | region_def('single_block') |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
verify_
method
def verify_() -> None: ...BroadcastOp
class View source
BroadcastOp(value: SSAValue | Operation, group: SSAValue | Operation, *, root: int | IntegerAttr, result_type: Attribute | None=None, attributes: Mapping[str, Attribute] | None=None)Bases: IRDLOperation
Broadcast one rank-local value from a statically selected group rank.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.broadcast' | |
value | operand_def() | |
group | operand_def(GroupType) | |
result | result_def() | |
root | attr_def(IntegerAttr) |
dependencies
method
def dependencies() -> OperationDependencies: ...Read corresponding value positions from the root rank.
verify_
method
def verify_() -> None: ...FHEliumDistributed
data View source
FHEliumDistributed = Dialect('fhelium_dist', [RankOp, GroupSizeOp, BroadcastOp, AllReduceOp, AllReduceAddCiphertextOp, YieldOp], [GroupType])GroupSizeOp
class View source
GroupSizeOp()Bases: _GroupQueryOp
Read the number of ranks in one launch-bound group.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.group_size' |
GroupType
class View source
GroupType()Bases: OpenStateType
Launch-bound collective group with optional provider metadata.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.group' |
OPERATION_SPECS
constant View source
OPERATION_SPECS: tuple[OperationSpec, ...] = (registered_operation_spec(RankOp, 'distributed', validator=flat_without_attributes), registered_operation_spec(GroupSizeOp, 'distributed', validator=flat_without_attributes), registered_operation_spec(BroadcastOp, 'distributed', effect='opaque', validator=_broadcast_specification), registered_operation_spec(AllReduceOp, 'distributed', effect='opaque', validator=_all_reduce_specification), registered_operation_spec(AllReduceAddCiphertextOp, 'distributed', effect='opaque', validator=lambda operation: (*flat_without_attributes(operation), *_same_value_type_specification(operation))), registered_operation_spec(YieldOp, 'distributed', validator=flat_without_attributes))RankOp
class View source
RankOp()Bases: _GroupQueryOp
Read this SPMD instance's rank in one launch-bound group.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.rank' |
YieldOp
class View source
YieldOp(value: SSAValue | Operation)Bases: IRDLOperation
Return one local combine result from a generic collective region.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_dist.yield' | |
value | operand_def() | |
traits | traits_def(IsTerminator()) |