-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
We have introduced the runtime::String to the tvm runtime. This new object can be used to replace most of the StringImm usages, except for the one that uses the IR. This issue tracks the refactor items to perform such migration.
-
Support automatic convertion to runtime::String when PackedFunc takes a str argument. [RUNTIME] Auto conversion from str to runtime::String in PackedFUnc #5251
-
Due to the nature of the refactor, we might need to do the following in a single PR. Here are some suggested steps that might make things easier(to expose error as early as possible in compilation)
-
Expose runtime::String to the tvm namespace https://github.com/apache/incubator-tvm/blob/master/include/tvm/node/node.h#L59
-
Change ffi_node_api String to return runtime::String instead of StringImm https://github.com/apache/incubator-tvm/blob/master/python/tvm/runtime/object_generic.py#L59
-
Remove the constructor from const char* for PrimExpr, this will reveal a lot of failures in compiler checks for the cases where we need to use String instead.
-
At this point, we will need quite a lot of failures in the topi side, fix most of the occurence of StringImm(usually under type PrimExpr and
Array<PrimExpr>) -
Keep the compiler ir part to still use StringImm