You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "jinhongyii (via GitHub)" <gi...@apache.org> on 2023/12/01 19:07:14 UTC

[PR] [Device][Metal] Fix metal warp size [tvm]

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

   metal warp size should be 1 on x86 device, but 32 on M1/M2 device


-- 
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] [Device][Metal] Fix metal warp size [tvm]

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

   cc: @junrushao @tqchen 


-- 
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] [Device][Metal] Fix metal warp size [tvm]

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


##########
src/runtime/metal/metal_device_api.mm:
##########
@@ -55,8 +55,13 @@
         break;
       }
       case kWarpSize: {
-        // Set warp size to be 1 for safty reason.
+#if defined(__x86_64__)
         *rv = 1;
+#elif defined(__aarch64__)
+        *rv = 32;
+#else
+        LOG(FATAL) << "Unknown architecture";

Review Comment:
   as a fall back, perhaps we should use `LOG(WARNING)` saying it's not x86 or aarch64, and then return 1 as a fallback



##########
src/runtime/metal/metal_device_api.mm:
##########
@@ -55,8 +55,13 @@
         break;
       }
       case kWarpSize: {
-        // Set warp size to be 1 for safty reason.
+#if defined(__x86_64__)
         *rv = 1;
+#elif defined(__aarch64__)
+        *rv = 32;
+#else
+        LOG(FATAL) << "Unknown architecture";

Review Comment:
   perhaps we should use `LOG(WARNING)` saying it's not x86 or aarch64, and then return 1 as a fallback



-- 
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] [Device][Metal] Fix metal warp size [tvm]

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


##########
src/runtime/metal/metal_device_api.mm:
##########
@@ -55,8 +55,13 @@
         break;
       }
       case kWarpSize: {
-        // Set warp size to be 1 for safty reason.
+#if defined(__x86_64__)
         *rv = 1;
+#elif defined(__aarch64__)
+        *rv = 32;
+#else
+        LOG(FATAL) << "Unknown architecture";

Review Comment:
   i agree @jinhongyii do you might do that?



-- 
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] [Device][Metal] Fix metal warp size [tvm]

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


##########
src/runtime/metal/metal_device_api.mm:
##########
@@ -55,8 +55,13 @@
         break;
       }
       case kWarpSize: {
-        // Set warp size to be 1 for safty reason.
+#if defined(__x86_64__)
         *rv = 1;
+#elif defined(__aarch64__)
+        *rv = 32;
+#else
+        LOG(FATAL) << "Unknown architecture";

Review Comment:
   I've changed it



-- 
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] [Device][Metal] Fix metal warp size [tvm]

Posted by "junrushao (via GitHub)" <gi...@apache.org>.
junrushao merged PR #16192:
URL: https://github.com/apache/tvm/pull/16192


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