19.7. Remote buffers
- class popxl.RemoteBuffer(tensor_shape, tensor_dtype, entries)
-
- __init__(tensor_shape, tensor_dtype, entries)
Store to or load from remote buffers residing in Streaming Memory.
This constructor will automatically assign a buffer ID and store the buffer information in the underlying
remoteBufferInfoMap
.- Parameters
- Raises
ValueError – If
entries
is a not a positive integer.- Return type
None
- property entries: int
Return the number of entries that can be stored in the buffer.
Setting the value of this property will update the size of the buffer.
- Returns
The number of tensors with the specified shape and type that can be stored in the buffer.
- Return type
- Raises
ValueError – If set to a value that is a not a positive integer.
- property remote_buffer_id: int
Return the ID of the buffer.
Note that the ID is read only.
- Returns
The ID of the buffer.
- Return type
- set_remote_buffer_info(tensor_dtype, tensor_shape, entries)
Store the buffer information in the underlying remoteBufferInfoMap.
- property tensor_dtype: popxl.dtypes.dtype
Return the type of the tensors stored in the buffer.
The type cannot be changed after the buffer has been created.
- property tensor_shape: Tuple[int, ...]
Return the shape of the tensors stored in the buffer.
The shape cannot be changed after the buffer has been created.
- Returns
The shape of the tensors stored in the buffer.
- Return type
Tuple[int, …]
- validate_tensor_matches_buffer(t, num_shards=1)
Validate whether the tensor information matches that of the buffer.
- Parameters
- Raises
ValueError – If the tensor does not match the buffer.
- Return type
None
- popxl.remote_buffer(tensor_shape, tensor_dtype, entries=1)
Return a remote buffer based on the current IR from the context.
- Parameters
- Returns
The remote buffer based on the current IR from the context.
- Return type