# Duplication of the driver between C++ and Python

**URL:** <https://discuss.tvm.apache.org/t/duplication-of-the-driver-between-c-and-python/9702>\
**Category:** Development\
**Created:** [April 14, 2021, 10:54am UTC](https://discuss.tvm.apache.org/t/duplication-of-the-driver-between-c-and-python/9702 "2021-04-14T10:54:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![manupa-arm](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/manupa-arm/32/2625_2.png) [@manupa-arm](https://discuss.tvm.apache.org/u/manupa-arm)\
**Post date:** [April 14, 2021, 11:13am UTC](https://discuss.tvm.apache.org/t/duplication-of-the-driver-between-c-and-python/9702/2 "2021-04-14T11:13:00Z")

</div>

Yes, this part had been a pain point in figuring out which part of the compilation pipeline is being run.

Regarding, the _lower_, I think C++ version is not run (maybe not anywhere in the tvm compilation – correct me if I am wrong) at the minute because there is a check for the registered python ffi of lower(…).

Moreover, I found out that some relay passes (e.g. foldconstants) rely on the interpreter (which runs the JIT() of compile engine) to build and execute part of the artifacts in the process of relay optimization pipeline. What is interesting is that JIT() of compile engine uses the driver/build\_module.py’s build though subsequently relay.build(…) will invoke the C++ version of build in driver\_api.cc later on.

Do we have a reason for the existence of both ? Moreover, is there an assumption in the design these two build(IRModule, TE) → runtime.Module functionality to be kept implicitly identical ?

also cc : @csullivan @jroesch

---

_[View the full topic](https://discuss.tvm.apache.org/t/duplication-of-the-driver-between-c-and-python/9702)._
