Is there a way to pass arguments to an external Codegen?

I am developing an external codegen/runtime for IPU and following the Bring Your Own Codegen To TVM tutorial more or less.

I’ve hit a snag in that the API for Poplar (the software stack for IPUs) needs to know the number of devices it will run on (and possibly the type of device also).

So I’m wondering if there is a way to pass information besides the module to compile to an external relay codegen.

Thanks for the interest. Currently we don’t have a way to pass additional arguments to the external codegen, but we do have a short term plan to add this feature. The RFC should be out in this week.

During this time, a workaround I can think of is through the environment variables. That is, set environment variables before running the build flow, and fetch the variables in your codegen for the additional information.

If there is going to be a way to do that soon, I can wait and make do with some default device for now.

Thanks for the info.

Just FYI. While the RFC shoudl be out this week as I mentioned, I am not sure how long will it take for the community to converage the design and review the PR. It will probably take 2-3 weeks in total I guess.

This fits my definition of soon so it’s fine.