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/12/16 23:58:35 UTC

[GitHub] [tvm] ashutosh-arm opened a new pull request, #13637: NPU driver updated to 22.11

ashutosh-arm opened a new pull request, #13637:
URL: https://github.com/apache/tvm/pull/13637

   NPU driver updated to 22.11.
   
   
   New process memory allocator is used to create
   buffers and networks. Support for 22.08 stack has
   been kept intact in the sources and tests until the new
   docker image is built and starts getting used. Tests
   were modified to meet limitations imposed on input
   zero point and kernel size by NPU software. Removed
   defining ETHON_API_VERSION from cmake infra.
   
   


-- 
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] lhutton1 commented on a diff in pull request #13637: NPU driver updated to 22.11

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


##########
tests/python/contrib/test_ethosn/test_conv2d_transpose.py:
##########
@@ -115,7 +116,7 @@ def _get_model(
     [
         ((1, 2, 2, 1), (2, 2), (1, 1), 1, False),
         ((1, 2, 2, 5), (2, 2), (3, 5), 4, False),
-        ((1, 7, 7, 4), (2, 2), (7, 9), 8, True),
+        ((1, 7, 7, 4), (2, 2), (7, 7), 8, True),

Review Comment:
   Curious, does this come from a change in the driver stack itself? It wasn't mentioned here: https://github.com/ARM-software/ethos-n-driver-stack/blob/main/CHANGELOG.md#2211 and, if so, this is wrong: https://github.com/ARM-software/ethos-n-driver-stack/blob/main/SUPPORTED.md?plain=1#L133



##########
tests/python/contrib/test_ethosn/test_leaky_relu.py:
##########
@@ -55,9 +56,12 @@ def test_leaky_relu(dtype, shape, alpha):
     iinfo = np.iinfo(dtype)
     zp_min = iinfo.min
     zp_max = iinfo.max
-    input_zp = zp_min + 120
+    if ethosn_api_version() == "3.2.0":
+        input_zp = zp_min + 128
+    else:
+        input_zp = zp_min + 120

Review Comment:
   Probably not worth the conditional, assuming `zp_min + 120` works for both the previous and new version?



##########
cmake/utils/FindEthosN.cmake:
##########
@@ -58,18 +58,6 @@ macro(find_ethosn use_ethosn)
       PATHS ${__ethosn_stack}/lib)
     find_library(ETHOSN_COMPILER_LIBRARY NAMES EthosNSupport)
 
-    list(GET ETHOSN_INCLUDE_DIRS 0 filename)
-    set(filename "${filename}/ethosn_support_library/Support.hpp")
-    file(READ ${filename} ETHOSN_SUPPORT_H)
-    string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${ETHOSN_SUPPORT_H})
-    set(ver_major ${CMAKE_MATCH_1})
-    string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${ETHOSN_SUPPORT_H})
-    set(ver_minor ${CMAKE_MATCH_1})
-    string(REGEX MATCH "VERSION_PATCH ([0-9]*)" _ ${ETHOSN_SUPPORT_H})
-    set(ver_patch ${CMAKE_MATCH_1})
-    set(ETHOSN_PACKAGE_VERSION "${ver_major}.${ver_minor}.${ver_patch}")
-    set(ETHOSN_DEFINITIONS -DETHOSN_API_VERSION=${USE_ETHOSN_API_VERSION})

Review Comment:
   Thanks for clearing this up :)



##########
tests/python/contrib/test_ethosn/test_conv2d_transpose.py:
##########
@@ -169,6 +170,72 @@ def test_conv2d_transpose(ifm_shape, strides, kernel_size, out_channels, dtype,
     tei.verify(outputs, dtype, 1)
 
 
+@pytest.mark.skipif(
+    ethosn_api_version() == "3.2.0",
+    reason="Skip because NPU driver 22.11 does not support following cases.",
+)
+@requires_ethosn

Review Comment:
   I had some trouble skipping like this in the past due to the way decorators are evaluated, might need to put the skip inside the function



-- 
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] ashutosh-arm commented on a diff in pull request #13637: NPU driver updated to 22.11

Posted by GitBox <gi...@apache.org>.
ashutosh-arm commented on code in PR #13637:
URL: https://github.com/apache/tvm/pull/13637#discussion_r1052044965


##########
tests/python/contrib/test_ethosn/test_conv2d_transpose.py:
##########
@@ -115,7 +116,7 @@ def _get_model(
     [
         ((1, 2, 2, 1), (2, 2), (1, 1), 1, False),
         ((1, 2, 2, 5), (2, 2), (3, 5), 4, False),
-        ((1, 7, 7, 4), (2, 2), (7, 9), 8, True),
+        ((1, 7, 7, 4), (2, 2), (7, 7), 8, True),

Review Comment:
   An issue has been raised with the NPU software to track this.



##########
cmake/utils/FindEthosN.cmake:
##########
@@ -58,18 +58,6 @@ macro(find_ethosn use_ethosn)
       PATHS ${__ethosn_stack}/lib)
     find_library(ETHOSN_COMPILER_LIBRARY NAMES EthosNSupport)
 
-    list(GET ETHOSN_INCLUDE_DIRS 0 filename)
-    set(filename "${filename}/ethosn_support_library/Support.hpp")
-    file(READ ${filename} ETHOSN_SUPPORT_H)
-    string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${ETHOSN_SUPPORT_H})
-    set(ver_major ${CMAKE_MATCH_1})
-    string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${ETHOSN_SUPPORT_H})
-    set(ver_minor ${CMAKE_MATCH_1})
-    string(REGEX MATCH "VERSION_PATCH ([0-9]*)" _ ${ETHOSN_SUPPORT_H})
-    set(ver_patch ${CMAKE_MATCH_1})
-    set(ETHOSN_PACKAGE_VERSION "${ver_major}.${ver_minor}.${ver_patch}")
-    set(ETHOSN_DEFINITIONS -DETHOSN_API_VERSION=${USE_ETHOSN_API_VERSION})

Review Comment:
   :smile: 
   



-- 
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 #13637: NPU driver updated to 22.11

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

   <!---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-ccs-start-->
    * No users to auto-tag found, no teams are specified in PR title <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-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] ashutosh-arm commented on a diff in pull request #13637: NPU driver updated to 22.11

Posted by GitBox <gi...@apache.org>.
ashutosh-arm commented on code in PR #13637:
URL: https://github.com/apache/tvm/pull/13637#discussion_r1052044754


##########
tests/python/contrib/test_ethosn/test_conv2d_transpose.py:
##########
@@ -169,6 +170,72 @@ def test_conv2d_transpose(ifm_shape, strides, kernel_size, out_channels, dtype,
     tei.verify(outputs, dtype, 1)
 
 
+@pytest.mark.skipif(
+    ethosn_api_version() == "3.2.0",
+    reason="Skip because NPU driver 22.11 does not support following cases.",
+)
+@requires_ethosn

Review Comment:
   Thanks for catching it. It caused CI failure in ci_arm.



-- 
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] ashutosh-arm commented on a diff in pull request #13637: NPU driver updated to 22.11

Posted by GitBox <gi...@apache.org>.
ashutosh-arm commented on code in PR #13637:
URL: https://github.com/apache/tvm/pull/13637#discussion_r1052044754


##########
tests/python/contrib/test_ethosn/test_conv2d_transpose.py:
##########
@@ -169,6 +170,72 @@ def test_conv2d_transpose(ifm_shape, strides, kernel_size, out_channels, dtype,
     tei.verify(outputs, dtype, 1)
 
 
+@pytest.mark.skipif(
+    ethosn_api_version() == "3.2.0",
+    reason="Skip because NPU driver 22.11 does not support following cases.",
+)
+@requires_ethosn

Review Comment:
   Thanks for catching it. It cause CI failure in ci_arm.



-- 
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] lhutton1 merged pull request #13637: [ETHOSN] Update driver stack version to 22.11

Posted by GitBox <gi...@apache.org>.
lhutton1 merged PR #13637:
URL: https://github.com/apache/tvm/pull/13637


-- 
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] ashutosh-arm commented on a diff in pull request #13637: NPU driver updated to 22.11

Posted by GitBox <gi...@apache.org>.
ashutosh-arm commented on code in PR #13637:
URL: https://github.com/apache/tvm/pull/13637#discussion_r1052044444


##########
tests/python/contrib/test_ethosn/test_leaky_relu.py:
##########
@@ -55,9 +56,12 @@ def test_leaky_relu(dtype, shape, alpha):
     iinfo = np.iinfo(dtype)
     zp_min = iinfo.min
     zp_max = iinfo.max
-    input_zp = zp_min + 120
+    if ethosn_api_version() == "3.2.0":
+        input_zp = zp_min + 128
+    else:
+        input_zp = zp_min + 120

Review Comment:
   I thought after this is fixed in 23.02, it will be worth having both the cases as a test.



-- 
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] ashutosh-arm commented on a diff in pull request #13637: NPU driver updated to 22.11

Posted by GitBox <gi...@apache.org>.
ashutosh-arm commented on code in PR #13637:
URL: https://github.com/apache/tvm/pull/13637#discussion_r1052044444


##########
tests/python/contrib/test_ethosn/test_leaky_relu.py:
##########
@@ -55,9 +56,12 @@ def test_leaky_relu(dtype, shape, alpha):
     iinfo = np.iinfo(dtype)
     zp_min = iinfo.min
     zp_max = iinfo.max
-    input_zp = zp_min + 120
+    if ethosn_api_version() == "3.2.0":
+        input_zp = zp_min + 128
+    else:
+        input_zp = zp_min + 120

Review Comment:
   I thought after this is fixed in 23.02, it will be worth having both the cases in the test.



-- 
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] lhutton1 commented on a diff in pull request #13637: NPU driver updated to 22.11

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


##########
tests/python/contrib/test_ethosn/test_leaky_relu.py:
##########
@@ -55,9 +56,12 @@ def test_leaky_relu(dtype, shape, alpha):
     iinfo = np.iinfo(dtype)
     zp_min = iinfo.min
     zp_max = iinfo.max
-    input_zp = zp_min + 120
+    if ethosn_api_version() == "3.2.0":
+        input_zp = zp_min + 128
+    else:
+        input_zp = zp_min + 120

Review Comment:
   Ah okay make sense, let's leave it for now then :)



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