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
import numpy as np
def identify_fusable_chain(...):
pass
Premium problem
Free accounts include problems #1–20. Upgrade to unlock the editor, hidden test cases, and reference solutions for every problem.
Already premium?