gemini-code-assist[bot] commented on code in PR #18539:
URL: https://github.com/apache/tvm/pull/18539#discussion_r2579492970


##########
docs/how_to/tutorials/e2e_opt_model.py:
##########
@@ -113,12 +113,14 @@
 # We skip this step in the CI environment.
 
 if not IS_IN_CI:
+    with target:
+        mod = tvm.tir.transform.DefaultGPUSchedule()(mod)

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   There's an inconsistency in the target usage that could be confusing for 
users of this tutorial. A specific `target` object is defined earlier, but the 
`tvm.compile` call on the next line uses a generic `"cuda"` string. For better 
clarity and to ensure device-specific optimizations are used, it's best to be 
consistent. I recommend moving the `tvm.compile` call inside this `with` block 
and using the `target` variable you've already defined, like so:
   
   ```python
   with target:
       mod = tvm.tir.transform.DefaultGPUSchedule()(mod)
       ex = tvm.compile(mod, target=target)
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to