fhelium.ir.dialects.memory
Rank-local device and memory-transfer operations.
Placement changes are represented by real operations rather than attributes on unrelated arithmetic. A transfer consumes one value and one launch-bound device resource and returns the same IR value type. Concrete movement, allocation, and same-device alias choices remain Backend responsibilities.
DeviceType
class View source
python
DeviceType()1
Bases: OpenStateType
Launch-bound execution device with optional provider metadata.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_memory.device' |
FHEliumMemory
data View source
python
FHEliumMemory = Dialect('fhelium_memory', [TransferOp], [DeviceType])1
OPERATION_SPECS
constant View source
python
OPERATION_SPECS: tuple[OperationSpec, ...] = (registered_operation_spec(TransferOp, 'memory', validator=_transfer_specification),)1
TransferOp
class View source
python
TransferOp(value: SSAValue | Operation, target: SSAValue | Operation, *, result_type: Attribute | None=None, memory_space: str | StringAttr | None=None, attributes: Mapping[str, Attribute] | None=None)1
Bases: IRDLOperation
Move or copy one rank-local value to a selected device and memory space.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_memory.transfer' | |
value | operand_def() | |
target | operand_def(DeviceType) | |
result | result_def() | |
memory_space | opt_attr_def(StringAttr) | |
traits | traits_def(Pure()) |
dependencies
method
python
def dependencies() -> OperationDependencies: ...1
Preserve the transported value's coordinates on its destination.
verify_
method
python
def verify_() -> None: ...1