tqchen commented on code in PR #16254:
URL: https://github.com/apache/tvm/pull/16254#discussion_r1428865034


##########
python/tvm/relax/backend/dispatch_ops.py:
##########
@@ -0,0 +1,156 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=invalid-name, unused-argument, redefined-argument-from-local
+"""Dispatch platform dependent operators to related implementation."""
+
+from tvm.ir.module import IRModule
+from tvm.ir.transform import PassContext
+from tvm import relax
+from tvm.relax import Expr, Function
+from tvm.relax.dpl import is_op, rewrite_call, wildcard, has_target
+
+from ..transform import function_pass
+from tvm.topi.utils import prod, swap
+
+
+@function_pass(opt_level=0)
+class DispatchOps:
+    """
+    Pass to dispatch operators to platform dependent implementation.
+    """
+
+    def __init__(self):
+        self.input = wildcard()

Review Comment:
   Given we are only dealing with a single op. Let us simply write a pass 
without the pattern language. Since pattern rewrite have its own overhead.
   
   We need to dispatch to topi.cuda.sort and topi.cuda.scan for the sort and 
scan ops



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