Lunderberg commented on a change in pull request #10530:
URL: https://github.com/apache/tvm/pull/10530#discussion_r823741084
##########
File path: python/tvm/driver/build_module.py
##########
@@ -275,7 +275,7 @@ def build(
annotated_mods, target_host =
Target.check_and_update_host_consist(annotated_mods, target_host)
- rt_mod_host = _driver_ffi.preprocess_module(annotated_mods, target_host)
+ rt_mod_host = _driver_ffi.build(annotated_mods, target_host)
Review comment:
From my understanding, I think this would fix accidental recursion, if a
user has implemented a `TIRToRuntime` hook in Python, and that `TIRToRuntime`
hook internally calls the `build_module.build` function. For a C++
implementation of `TIRToRuntime`, a user would call `tvm::build` directly, and
get the recursion check, but that doesn't exist in `PreProcessModuleForBuild`.
That said, I haven't tested it to verify whether this failure mode could be
triggered.
I did some delving into the git commit history prior when trying to
understand if there was an intentional difference between the functions, and I
think this difference is due to accidental drift. From the commit history,
both `PreProcessModuleForBuild` (PR #9103, later renamed in PR #9297) and the
introduction of the `TIRToRuntime` hook (PR #9190) were occurring at roughly
the same time, with #9190 being submitted and merged while #9103 was in review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]