tqchen commented on code in PR #17599:
URL: https://github.com/apache/tvm/pull/17599#discussion_r1929555114


##########
src/script/printer/relax/utils.h:
##########
@@ -141,7 +141,7 @@ inline int FindVDeviceIndexByTargetKind(const VDevice& 
vdevice, const IRDocsifie
   int kind_index = 0;
   for (size_t i = 0; i < vdevices.size(); ++i) {
     auto vdev = Downcast<VDevice>(vdevices[i]);
-    if (vdev.same_as(vdevice)) {
+    if (vdev == vdevice) {

Review Comment:
   ideally we would like to deduplicate vdevice globally via ptr equality, is 
it possible to get the pass to generate the same vdevice instead?



##########
python/tvm/relax/transform/transform.py:
##########
@@ -1092,6 +1095,10 @@ def LegalizeOps(
         legalization function is not registered. By default we don't print
         warnings.
 
+    add_attributes : bool

Review Comment:
   is it possible to compose instead? e.g. run attribute attach pass after.



##########
include/tvm/relax/transform.h:
##########
@@ -666,6 +668,24 @@ TVM_DLL Pass RewriteCUDAGraph();
  */
 TVM_DLL Pass FewShotTuning(int valid_count, bool benchmark);
 
+/*!
+ * \brief This pass is designed to annotate the memory scope information via 
VDevice attribute.
+ * This pass need operator attrbutes which in general vanish aftre 
legalization.
+ * FuseOps and FuseTIR are modified to pass on the operator specific 
attributes and also
+ * op_pattern details as part of the PrimFunc. This pass is Adreno specific 
and annotates each
+ * BindingVar with appropriate HintInDevice. RealizeVDevice pass followed by 
handles these hints.
+ * Followed by this pass we also invoke SpecializeTIRParams which updates the 
var_buffer_map
+ * based on this new VDevice information.
+ */
+TVM_DLL Pass AnnotateCustomMemoryScope(Target target);
+
+/*!
+ * \brief This pass updates the var_buffer mapping of PrimFunctions from the 
call_tir info.
+ * Primarily used to update the VDevice information is any changes occured 
from the caller.
+ * This pass recreated the buffers and updates the map.
+ */

Review Comment:
   SpecializeTIRParams is a bit too generic. let us rename as 
SpecializePrimFuncBasedOnCallSite



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

Reply via email to