merrymercy commented on a change in pull request #5898:
URL: https://github.com/apache/incubator-tvm/pull/5898#discussion_r444983276
##########
File path: src/tir/analysis/verify_gpu_code.cc
##########
@@ -129,6 +134,17 @@ class GPUCodeVerifier : public StmtVisitor {
}
}
+ void VisitExpr_(const LoadNode* op) {
+ // Currently not able to check out: If the index expression failed
+ // to be simplified to a RampNode
+ if (op->index->IsInstance<RampNode>()) {
+ if (op->dtype.lanes() > 1) {
+ valid_ &= op->dtype.lanes() * op->dtype.bytes() <=
static_cast<int>(max_vector_bytes_);
Review comment:
Same as the above.
##########
File path: src/tir/analysis/verify_gpu_code.cc
##########
@@ -62,6 +64,9 @@ class GPUCodeVerifier : public StmtVisitor {
size_t size = static_cast<size_t>(op->constant_allocation_size());
shared_memory_per_block_ += size * op->dtype.bytes() * op->dtype.lanes();
}
+ if (op->dtype.lanes() > 1) {
+ valid_ &= op->dtype.lanes() * op->dtype.bytes() <=
static_cast<int>(max_vector_bytes_);
Review comment:
Cast INT64_MAX to int will overflow. You should cast the LHS.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]