You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Lunderberg (via GitHub)" <gi...@apache.org> on 2024/03/15 13:05:30 UTC

[PR] [TIR] LowerTVMBuiltin may use device_type from PrimFunc annotation [tvm]

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

   If an allocation occurs within a host function, it may not have a device/host split, and may just be annotated with `"tir.is_host_func"`.


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

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


Re: [PR] [TIR] LowerTVMBuiltin may use device_type from PrimFunc annotation [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on PR #16727:
URL: https://github.com/apache/tvm/pull/16727#issuecomment-2025084219

   Closing this PR, as changes were required for https://github.com/apache/tvm/pull/16721, and were merged as part of that PR.


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

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


Re: [PR] [TIR] LowerTVMBuiltin may use device_type from PrimFunc annotation [tvm]

Posted by "slyubomirsky (via GitHub)" <gi...@apache.org>.
slyubomirsky commented on code in PR #16727:
URL: https://github.com/apache/tvm/pull/16727#discussion_r1538357879


##########
tests/python/tir-transform/test_tir_transform_lower_tvm_builtin.py:
##########
@@ -260,11 +260,13 @@ def expected():
 
 
 class TestLowerAllocateRequiresDeviceID(tvm.testing.CompareBeforeAfter):
+    """If device id is missing, error."""
+
     transform = tvm.tir.transform.LowerTVMBuiltin()
 
     def before():
         T.func_attr({"target": T.target("llvm")})
-        T.attr("dummy", "device_id", 0)
+        T.attr("dummy", "device_type", 2)  # kDLCuda

Review Comment:
   Is this constant defined anywhere on the Python side? Perhaps it should be, to avoid such magic numbers (if we expect that to happen again).



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

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


Re: [PR] [TIR] LowerTVMBuiltin may use device_type from PrimFunc annotation [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on code in PR #16727:
URL: https://github.com/apache/tvm/pull/16727#discussion_r1539352746


##########
tests/python/tir-transform/test_tir_transform_lower_tvm_builtin.py:
##########
@@ -260,11 +260,13 @@ def expected():
 
 
 class TestLowerAllocateRequiresDeviceID(tvm.testing.CompareBeforeAfter):
+    """If device id is missing, error."""
+
     transform = tvm.tir.transform.LowerTVMBuiltin()
 
     def before():
         T.func_attr({"target": T.target("llvm")})
-        T.attr("dummy", "device_id", 0)
+        T.attr("dummy", "device_type", 2)  # kDLCuda

Review Comment:
   Good question, and looks like it is defined in the `tvm.runtime.Device` struct.  I've updated the usage here, and throughout this unit test file.



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

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


Re: [PR] [TIR] LowerTVMBuiltin may use device_type from PrimFunc annotation [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg closed pull request #16727: [TIR] LowerTVMBuiltin may use device_type from PrimFunc annotation
URL: https://github.com/apache/tvm/pull/16727


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

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