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


##########
python/tvm/runtime/disco/session.py:
##########
@@ -103,6 +109,10 @@ class Session(Object):
     """A Disco interactive session. It allows users to interact with the Disco 
command queue with
     various PackedFunc calling convention."""
 
+    # Opt out of the default `__slots__ = ()` of tvm_ffi Object subclasses, as
+    # the session caches method lookups in dynamic instance attributes.
+    __slots__ = ("__dict__",)

Review Comment:
   better approach is to add slot session and _cache



##########
python/tvm/runtime/disco/session.py:
##########
@@ -78,6 +78,10 @@ def debug_copy_from(
 class DPackedFunc(DRef):
     """A PackedFunc in a Disco session."""
 
+    # Opt out of the default `__slots__ = ()` of tvm_ffi Object subclasses to
+    # allow Python-side instance attributes (the associated `session`).
+    __slots__ = ("__dict__",)

Review Comment:
   better approach is to add slot session



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