You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/28 18:49:26 UTC

[GitHub] [tvm] joshherr-quic opened a new pull request, #12931: [Hexagon] 8 bit lut using tvm script (sqrt,negative)

joshherr-quic opened a new pull request, #12931:
URL: https://github.com/apache/tvm/pull/12931

   This PR creates a lut primfunc for arbitrary python functions. That is, if you can supply a python function that describes the compute, a lut can be generated for it. The name of the output compute has to match a function in the dict registry in lut.py. Ie. sqrt's compute output is named "sqrt" and maps to math.sqrt.
   
   The generic tvm IR is stored in a string. Compile time constants are inserted into the string, which is then parsed into TIR and vectorized.


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


[GitHub] [tvm] joshherr-quic commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1309706807

   @tvm-bot rerun


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


[GitHub] [tvm] mehrdadh commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1317350771

   You need to rebase with main since there has been some changes in the CI


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


[GitHub] [tvm] mehrdadh commented on a diff in pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on code in PR #12931:
URL: https://github.com/apache/tvm/pull/12931#discussion_r1019433364


##########
python/tvm/topi/hexagon/qnn/injective.py:
##########
@@ -0,0 +1,192 @@
+# 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

Review Comment:
   please remove and fix the lint issues



##########
python/tvm/topi/hexagon/lut.py:
##########
@@ -0,0 +1,74 @@
+# 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.
+
+"""Schedule for injective operators"""
+
+# pylint: disable=unused-import

Review Comment:
   remove?



##########
tests/python/contrib/test_hexagon/test_lut.py:
##########
@@ -0,0 +1,89 @@
+# 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.
+
+"""Test for LUT"""
+
+import math
+
+import tvm
+from tvm import te
+import tvm.testing
+from tvm.contrib.hexagon.session import Session
+import tvm.contrib.hexagon
+import numpy as np
+from .infrastructure import quantize_np
+
+HEX_TARGET = tvm.target.hexagon("v68", link_params=True)

Review Comment:
   maybe use get_hexagon_target instead?



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


[GitHub] [tvm] tvm-bot commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1294366420

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-docs-start-->
    * Built docs for commit dfa6049e2db9253d24050c93c48020748779114d can be found [here](https://pr-docs.tlcpack.ai/PR-12931/10/docs/index.html).<!--bot-comment-docs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


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


[GitHub] [tvm] joshherr-quic commented on a diff in pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on code in PR #12931:
URL: https://github.com/apache/tvm/pull/12931#discussion_r1021888230


##########
python/tvm/topi/hexagon/lut.py:
##########
@@ -0,0 +1,74 @@
+# 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.
+
+"""Schedule for injective operators"""
+
+# pylint: disable=unused-import

Review Comment:
   The math import is required for some of the injective lut 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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] joshherr-quic commented on pull request #12931: [Hexagon] 8 bit lut using tvm script (sqrt,negative)

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1261721057

   Looks like the Windows and MacOS builder machines are missing the python package "synr"


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


[GitHub] [tvm] mehrdadh commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1301197512

   @tvm-bot rerun


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


[GitHub] [tvm] joshherr-quic commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1314287484

   @tvm-bot  rerun


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


[GitHub] [tvm] joshherr-quic commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
joshherr-quic commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1317299149

   @mehrdadh Hey not sure what's going on with the CI. It's failing at the prepare step.


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


[GitHub] [tvm] mehrdadh commented on pull request #12931: [Hexagon] 8 bit lut using tvm script for elemwise operators

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on PR #12931:
URL: https://github.com/apache/tvm/pull/12931#issuecomment-1301259329

   pylint is enabled for the test directory. Please fix the pylint issues


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