ml_switcheroo.compiler.backends.rdna.macros =========================================== .. py:module:: ml_switcheroo.compiler.backends.rdna.macros .. autoapi-nested-parse:: RDNA Macro Expansion Logic. Procedural generators for complex RDNA kernel logic (Conv2d, Linear). Classes ------- .. autoapisummary:: ml_switcheroo.compiler.backends.rdna.macros.RegisterAllocatorProtocol Functions --------- .. autoapisummary:: ml_switcheroo.compiler.backends.rdna.macros.expand_conv2d ml_switcheroo.compiler.backends.rdna.macros.expand_linear Module Contents --------------- .. py:class:: RegisterAllocatorProtocol Bases: :py:obj:`Protocol` Protocol for the Dual-Pool Register Allocator. .. py:method:: get_vector_register(var_name: str) -> ml_switcheroo.compiler.frontends.rdna.nodes.VGPR Gets or allocates a VGPR. .. py:method:: get_scalar_register(var_name: str) -> ml_switcheroo.compiler.frontends.rdna.nodes.SGPR Gets or allocates an SGPR. .. py:method:: allocate_vector_temp() -> ml_switcheroo.compiler.frontends.rdna.nodes.VGPR Allocates temp VGPR. .. py:method:: allocate_scalar_temp() -> ml_switcheroo.compiler.frontends.rdna.nodes.SGPR Allocates temp SGPR. .. py:function:: expand_conv2d(allocator: RegisterAllocatorProtocol, node_id: str, metadata: Dict[str, Any]) -> List[ml_switcheroo.compiler.frontends.rdna.nodes.RdnaNode] Generates the RDNA assembly kernel for a 2D Convolution loop. .. py:function:: expand_linear(allocator: RegisterAllocatorProtocol, node_id: str, metadata: Dict[str, Any]) -> List[ml_switcheroo.compiler.frontends.rdna.nodes.RdnaNode] Generates the RDNA assembly kernel for a Linear Layer.