iree.turbine.dynamo¶
- class iree.turbine.dynamo.DeviceTensor(size, dtype, raw_data=None, requires_grad=False)¶
A Tensor accessing memory on a Turbine device.
- property buffer_view: HalBufferView¶
- cpu(memory_format=torch.preserve_format) Tensor¶
Returns a copy of this object in CPU memory.
If this object is already in CPU memory, then no copy is performed and the original object is returned.
- Parameters:
memory_format (
torch.memory_format, optional) – the desired memory format of returned Tensor. Default:torch.preserve_format.
- property device¶
Is the
torch.devicewhere this Tensor is.
- static from_torch(input_tensor: Tensor)¶
- class iree.turbine.dynamo.TurbineMode¶
Enables PyTorch tensor device= support for Tensor factory functions.
This can be used in a with block to dynamically scope enablement, or it can be enabled globally via the enable() function.
- CACHED_IMPLEMENTATIONS: dict = {}¶
- COMPUTE_METHODS = {<built-in method abs of type object>, <built-in method add of type object>, <built-in method mul of type object>, <built-in method sub of type object>}¶
- IMPLEMENTATIONS: dict = {<built-in function _parse_to>: <function _parse_to>, <built-in method arange of type object>: <function device_factory.<locals>._inner_fn.<locals>._filter_impl>, <built-in method empty of type object>: <function device_factory.<locals>._inner_fn.<locals>._filter_impl>, <built-in method ones of type object>: <function device_factory.<locals>._inner_fn.<locals>._filter_impl>, <built-in method rand of type object>: <function device_factory.<locals>._inner_fn.<locals>._filter_impl>, <built-in method zeros of type object>: <function device_factory.<locals>._inner_fn.<locals>._filter_impl>, <method 'to' of 'torch._C.TensorBase' objects>: <function to>}¶
- iree.turbine.dynamo.enable()¶
Enables PyTorch tensor device= support for Turbine permanently.