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 2021/10/28 11:52:48 UTC

[GitHub] [tvm] stoa opened a new pull request #9385: STM32: add as a new target

stoa opened a new pull request #9385:
URL: https://github.com/apache/tvm/pull/9385


   @areusch 
   This small pull request aims at adding the STM32 as a new target to a set of TVM targets.
   


-- 
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] areusch commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
areusch commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r746170648



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       > We first aligned with the CubeAI libraries that have a library per series.
   
   Do these libraries contain implemented kernels? (e.g. do you intend to integrate them similarly to CMSIS-NN?)
   
   if we move to one board id per target string, won't there be quite a lot of repetition? possible to compress the table somehow (e.g. just look at the board id prefix)? at least, perhaps we could start with something like that? in general we'd like to avoid manual per-board configuration in TVM if possible (but I'm asking the question above in case we need to consider 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



[GitHub] [tvm] stoa commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r739081718



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       @areusch 
   Upon a second thought ...
   We first aligned with the CubeAI libraries that have a library per series. However, even within a given series there may be differences depending on the target board. So, it makes a better sense to distinguish targets per board ID. Additionally, the CubeMX also takes the board ID as a starting point. Finally, it will be easier for the user.
   Alternatively, if a user needs to use a model compiled for the same series but a different board, if they know what they are doing (memory sizes for example) - it will work as well.
   So, let's move to the board ID. And then this table will get large (dozens of entries or more). Perhaps we should imagine a separate file to keep it in ?




-- 
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] stoa commented on pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#issuecomment-1022150764


   @areusch 
   Hello, Andrew
   Yes. If you agree it is ready to become a PR, I fix the issues and publish ?


-- 
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] stoa commented on pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#issuecomment-1038211460


   @areusch 
   Made lint checks and rebased. Please review.
   cheers
   Arthur


-- 
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] areusch commented on pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#issuecomment-1019745226


   @stoa shall we progress this one as well? i think it needs some lint fixes and perhaps a rebase.


-- 
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] stoa commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r756967754



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       Back to specifying the series.
   There are 17 series altogether - I have listed 14, did not list connectivity series.
   Although multiple series refer to the same CPU, the differences exist with their memory configurations. This will show in the schedules that TVM will have to generate. I am working on different schedules for different targets.
   Arthur




-- 
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] areusch commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
areusch commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r738618702



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       how large do we expect this python dict to get? also, want to double-confirm you want to create an entry per series.  what happens if a user passes the exact board name for `model`, since it is called `model` and not `model_series`?




-- 
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] areusch commented on pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#issuecomment-1026486476


   @stoa yep it looks ok to merge to me, it just needs the rebase and lint fixing.


-- 
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] stoa commented on pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#issuecomment-1038211460


   @areusch 
   Made lint checks and rebased. Please review.
   cheers
   Arthur


-- 
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] areusch commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
areusch commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r746170648



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       > We first aligned with the CubeAI libraries that have a library per series.
   Do these libraries contain implemented kernels? (e.g. do you intend to integrate them similarly to CMSIS-NN?)
   
   if we move to one board id per target string, won't there be quite a lot of repetition? possible to compress the table somehow (e.g. just look at the board id prefix)? at least, perhaps we could start with something like that? in general we'd like to avoid manual per-board configuration in TVM if possible (but I'm asking the question above in case we need to consider 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



[GitHub] [tvm] stoa commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r747490255



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       Hello, Andrew
   No, we do not intend to integrate the CubeAI libraries with the TVM.
   Let me think how to compact the target options table.




-- 
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] stoa commented on a change in pull request #9385: STM32: add as a new target

Posted by GitBox <gi...@apache.org>.
stoa commented on a change in pull request #9385:
URL: https://github.com/apache/tvm/pull/9385#discussion_r756968439



##########
File path: python/tvm/target/target.py
##########
@@ -642,6 +642,27 @@ def create_tvm_options(cpu_ver, config):  # pylint: disable=unused-argument
 
     return Target(" ".join(["hexagon"] + args_list))
 
+STM32_SUPPORTED_MODELS = {
+    #"stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7", "-march=armv7e-m"],
+    "stm32H7xx": ["-device=arm_cpu", "-mcpu=cortex-m7"],

Review comment:
       @areusch 
   Have forgotten this ...




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