# How to get ir.ExternKernel instance to initialize inductor Scheduler?

**URL:** <https://dev-discuss.pytorch.org/t/how-to-get-ir-externkernel-instance-to-initialize-inductor-scheduler/1143>\
**Category:** compiler\
**Created:** [March 21, 2023, 6:55am UTC](https://dev-discuss.pytorch.org/t/how-to-get-ir-externkernel-instance-to-initialize-inductor-scheduler/1143 "2023-03-21T06:55:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ami](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@ami](https://dev-discuss.pytorch.org/u/ami)\
**Post date:** [March 21, 2023, 6:55am UTC](https://dev-discuss.pytorch.org/t/how-to-get-ir-externkernel-instance-to-initialize-inductor-scheduler/1143/1 "2023-03-21T06:55:42Z")

</div>

From the “\__init_\_” method of Scheduler class in \_inductor/scheduler.py, we see that the input nodes could be ir.ComputedBuffer, ir.TemplateBuffer or ir.ExternKernel instance list, but how can we construct a module to generate ir.ExternKernel instance to initialize the Scheduler?

---

<div class="post-metadata">

**Author:** ![ami](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@ami](https://dev-discuss.pytorch.org/u/ami)\
**Post date:** [March 24, 2023, 10:13am UTC](https://dev-discuss.pytorch.org/t/how-to-get-ir-externkernel-instance-to-initialize-inductor-scheduler/1143/2 "2023-03-24T10:13:22Z")

</div>

The operator via make\_fallback in torch/\_inductor/lowering.py will produce ExternKernel ( ir.FallbackKernel ), instance, such as torch.fmax.  
And convolution operator will produce ExternKernel, such as F.conv2d.
