You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/06 21:40:24 UTC

[GitHub] [tvm] vinx13 opened a new pull request, #10923: [TIR] Check dynamic shared memory in VerifyGPUCode

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

   cc @junrushao1994 @masahi 


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


[GitHub] [tvm] masahi commented on a diff in pull request #10923: [TIR] Check dynamic shared memory in VerifyGPUCode

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #10923:
URL: https://github.com/apache/tvm/pull/10923#discussion_r844580948


##########
src/tir/analysis/verify_gpu_code.cc:
##########
@@ -61,11 +62,12 @@ class GPUCodeVerifier : public StmtExprVisitor {
   void VisitStmt_(const AllocateNode* op) final {
     StmtVisitor::VisitStmt_(op);
     auto scope = GetPtrStorageScope(op->buffer_var);
+    runtime::StorageScope storage_scope = runtime::StorageScope::Create(scope);
     // visit an allocation of a buffer in shared memory, record its size
-    if (scope == "local") {
+    if (storage_scope.rank == runtime::StorageRank::kLocal) {
       size_t size = static_cast<size_t>(op->ConstantAllocationSize());
       local_memory_per_block_ += size * op->dtype.bytes() * op->dtype.lanes();
-    } else if (scope == "shared") {
+    } else if (storage_scope.rank == runtime::StorageRank::kShared) {
       size_t size = static_cast<size_t>(op->ConstantAllocationSize());

Review Comment:
   Note that `op->ConstantAllocationSize()` is 0 for symbolic shape dyn-shared memory. But `VerifyGPUCode` cannot do anything with symbolic shape, so this should be fine.



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


[GitHub] [tvm] masahi merged pull request #10923: [TIR] Check dynamic shared memory in VerifyGPUCode

Posted by GitBox <gi...@apache.org>.
masahi merged PR #10923:
URL: https://github.com/apache/tvm/pull/10923


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