Name for Compiler Driver

In the recent unified IR refactor. We isolate the end to end compilation modules into a separate folder(tentative name driver).

The main rationale behind the decision is that we want to separate the project into infrastructure components(relay, tir, target) that provides tools for phases of compilation optimizations and end to end driving functions(build) that takes these components and run end to end compilation.

While the refactor has not yet bring all the things unto this separation, we have already established the folder structures for us to do so. Under the new convention, features such as relay/graph_runtime_codegen and relay/vm_compiler should goes to target and the tools that stiches things together should goes to driver.

This RFC discusses the naming convention for driver. Currently, we adopted the name driver because “compiler driver” is a common term among existing compiler infrastructures such as Rust, Clang, Chisel, GHC.

On the other hand, the name “driver” could also mean runtime driver API, which is different from the “compiler driver”.

We have thought about possible alternatives, another term that comes up is compiler. However, “compiler” usually refers to the system as a whole, rather than the driving component.

Our current strawman is to bite the bullet and use the term driver, because TVM itself is a compiler infra and its runtime driver component is clearly isolated under the runtime folder. But we also want to see the community has better ideas.

Please share your thoughts.

I think the name driver is fine for the folder, given that developers would infer its function with the full path of the folder.

Compiler Driver to me indicates a common set of scripts or something that helps “drive” compilation. This seems more like driver API and thus I would suggest driver_api.

Ramana

Thanks @ramana-arm @liangfu for helpful comments. With respect to the term “API”, I agree that “driver api” was a better desciption for the usage. On the other hand, one could also say that “everything under include” are supposed to be API, which makes the term API redundant

If it’s only under include, then I’m less fussed about the ‘driver’ name.

Ramana

OK, to summarize, perhaps we can make the following change:

  • include/driver/driver_api.h which includes the driver APIs
  • src/driver/driver_api.cc