Skip to content

[inductor] remove hardcoded mapping to resolve ops from ExternKernelSchedulerNode #147137

@xmfan

Description

@xmfan

🐛 Describe the bug

https://github.com/pytorch/pytorch/pull/146992/files#r1953070064

during runtime estimation, we use this reverse map to lookup ops contained in ExternKernelSchedulerNode

# TODO(xmfan): reuse: an existing mapping for this if it exists, or formalize this into ir.py:ExternKernel
kernel_name_to_op = {
"extern_kernels.convolution": torch.ops.aten.convolution,
"extern_kernels.mm": torch.ops.aten.mm,
"extern_kernels.bmm": torch.ops.aten.bmm,
"extern_kernels.addmm": torch.ops.aten.addmm,
}

i've been wanting to find an existing registration system, per @eellison one alternative can be FlopCounter registrations

Versions

main

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @amjames @aakhundov

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: inductoroncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions