masahi commented on code in PR #11478:
URL: https://github.com/apache/tvm/pull/11478#discussion_r883118078


##########
src/runtime/cuda/cuda_module.cc:
##########
@@ -164,11 +164,22 @@ class CUDAWrappedFunc {
   void operator()(TVMArgs args, TVMRetValue* rv, void** void_args) const {
     int device_id;
     CUDA_CALL(cudaGetDevice(&device_id));
+    ThreadWorkLoad wl = launch_param_config_.Extract(args);
+
     if (fcache_[device_id] == nullptr) {
       fcache_[device_id] = m_->GetFunc(device_id, func_name_);
+      if (wl.dyn_shmem_size >= (48 << 10)) {
+        // Assumption: dyn_shmem_size doesn't change across different 
invocations of
+        // fcache_[device_id]

Review Comment:
   This assumption could be controversial, but this should be mostly ok in 
practice. To support a kernel which uses different big shmem sizes depending on 
input, we need to call `cuFuncSetAttribute` on every invocation. 



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