You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2026/04/05 17:59:41 UTC

[PR] [Docs] Add tvm.s_tir.analysis API reference page [tvm]

tlopex opened a new pull request, #19353:
URL: https://github.com/apache/tvm/pull/19353

   This PR adds the API reference documentation for `tvm.s_tir.analysis`.                      
                                                              
   `tvm.s_tir.analysis` functions use Var in their type annotations, which exists in both `tvm.tirx` and `tvm.relax`. The existing disambiguator uses common module prefix to pick the right one, but `tvm.s_tir` shares no prefix with either. The new `tvm_module_type_preference` mapping tells the disambiguator to prefer `tvm.tirx` types for `tvm.s_tir.*` modules.
   


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [Docs] Add tvm.s_tir.analysis API reference page [tvm]

Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex merged PR #19353:
URL: https://github.com/apache/tvm/pull/19353


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [Docs] Add tvm.s_tir.analysis API reference page [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19353:
URL: https://github.com/apache/tvm/pull/19353#discussion_r3037165677


##########
docs/conf.py:
##########
@@ -721,6 +728,14 @@ def _dedup_find_obj(self, env, modname, classname, name, objtype, searchmode=0):
                 if len(best_matches) == 1:
                     return best_matches
 
+            # Check module type preference for cross-module resolution
+            # (e.g. tvm.s_tir.analysis uses types from tvm.tirx).
+            for prefix, preferred_mod in tvm_module_type_preference.items():
+                if modname.startswith(prefix):
+                    preferred = [m for m in matches if m[0].startswith(preferred_mod + ".")]

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The `startswith` checks on `modname` and `m[0]` are a bit too broad and could match modules that share a prefix but are not sub-modules (e.g., `tvm.s_tir_extra` would match `tvm.s_tir`). It's safer to check for an exact match or a trailing dot to ensure it only applies to the intended module and its sub-modules.
   
   ```suggestion
                   if modname == prefix or modname.startswith(prefix + "."):
                       preferred = [m for m in matches if m[0] == preferred_mod or m[0].startswith(preferred_mod + ".")]
   ```



-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org