Given a list of ops with kinds in {'gemm', 'elementwise', 'reduction', 'memory'}, group consecutive indices that can fuse into a single kernel.
Signature: def identify_fusable_chain(ops: list) -> list
ops: list of {'kind': str} dictselementwise → elementwise: fusegemm → elementwise: fuse (epilogue fusion)reduction or memory op breaks the chain — it stands aloneReturn a list of lists of indices, in order.
Example: [gemm, elementwise, elementwise, reduction, elementwise] → [[0, 1, 2], [3], [4]].
Math
Asked at
Test Results