# \[Question\] Can self-contained BYOC be achieved via micro-kernel Injection?

**URL:** <https://discuss.tvm.apache.org/t/question-can-self-contained-byoc-be-achieved-via-micro-kernel-injection/18947>\
**Category:** Questions\
**Created:** [March 9, 2026, 3:10pm UTC](https://discuss.tvm.apache.org/t/question-can-self-contained-byoc-be-achieved-via-micro-kernel-injection/18947 "2026-03-09T15:10:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![garfield0xff-cochl](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/garfield0xff-cochl/32/6159_2.png) [@garfield0xff-cochl](https://discuss.tvm.apache.org/u/garfield0xff-cochl)\
**Post date:** [March 9, 2026, 3:10pm UTC](https://discuss.tvm.apache.org/t/question-can-self-contained-byoc-be-achieved-via-micro-kernel-injection/18947/1 "2026-03-09T15:10:17Z")

</div>

I am currently exploring a “runtime-less” or “minimal-dependency” deployment strategy using TVM.

While the standard **BYOC (Bring Your Own Codegen)** pipeline is powerful, it often requires linking against external libraries, which introduces build dependencies for edge devices.

I am trying to implement a pipeline that:

1. Performs Operation Pattern Matching on the Relax graph.
2. Instead of calling an external library function, it directly parses and extracts only the specific micro-kernel source code (C/C++ kernels) required for that pattern.
3. Injects this extracted source code into the TVM C source to create a self-contained, dependency-free binary.

**My questions:**

- Has anyone attempted this “selective kernel extraction” approach within the TVM ecosystem?
- Are there any existing RFCs, research papers, or projects that focus on stripping down external kernel libraries into standalone snippets for TVM’s source-based codegen?
- Would this approach be better implemented as a custom Relax Pass for code injection, or should it be handled within the External Codegen phase?

I would appreciate any insights, references, or pointers to similar efforts!
