slyubomirsky commented on PR #16634:
URL: https://github.com/apache/tvm/pull/16634#issuecomment-1979832554

   Fix for the `add_on_metal` bug: You need to update `IsScheduledOnGPU()` in 
`default_gpu_schedule.cc` to also include Metal in its definition of GPU.
   
   ```c++
   bool IsScheduledOnGPU(const BaseFunc& func) {
     // the target from context.
     tvm::Target target = tvm::Target::Current();
     // the Target in kTarget attribute of PrimFunc
     Optional<tvm::Target> func_target = 
func->attrs.GetAttr<tvm::Target>(tvm::attr::kTarget);
     if (func_target.defined()) {
       target = func_target.value();
     }
   
     if (target.defined()) {
       int dev_type = target->GetTargetDeviceType();
       if (!(dev_type == kDLCUDA || dev_type == kDLMetal || dev_type == kDLROCM 
||
             dev_type == kDLWebGPU)) {
         return false;
       }
     }
     return true;
   }
   ```
   Note that this issue was mentioned in the code review for the 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to