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/19 13:48:02 UTC

[GitHub] [tvm] gromero opened a new pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

gromero opened a new pull request #9320:
URL: https://github.com/apache/tvm/pull/9320


   Currently generate_project API method is copying the input MLF archive
   filename without renaming it to "model.tar" - hence not in accordance
   with the specification. As a consequence when the server looks for that
   file to determine if it's a project dir or a template dir it always
   determines it is a template dir since "model.tar" can never be found, so
   a TemplateProjectError() exception is thrown when instantiating a
   GeneratedProject class.
   
   This commit fixes that by correctly copying the input MLF archive to
   the newly generated project dir as "model.tar" so the server can find
   it.
   
   It also takes the chance to change the MLF path returned by
   server_info_query method: only if it's not a template dir the MLF path
   is returned, otherwise an empty string is returned (it doesn't make
   sense to return a MLF path when it's a template dir because there isn't
   any model associated to a template dir).
   
   Signed-off-by: Gustavo Romero <gu...@linaro.org>
   
   Thanks for contributing to TVM!   Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @ them in the pull request thread.
   


-- 
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] gromero commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   cc @mehrdadh @guberti @areusch 


-- 
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] gromero commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   Found when reviewing https://github.com/apache/tvm/pull/9289


-- 
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] leandron merged pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

Posted by GitBox <gi...@apache.org>.
leandron merged pull request #9320:
URL: https://github.com/apache/tvm/pull/9320


   


-- 
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] gromero edited a comment on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

Posted by GitBox <gi...@apache.org>.
gromero edited a comment on pull request #9320:
URL: https://github.com/apache/tvm/pull/9320#issuecomment-946789686


   > @gromero is it possible to replicate the scenario in a test?
   
   @Mousius Yes, below is a repro. So all a test needs to do is  generate a project dir based on Arduino default template. I haven't looked closely why current tests don't catch it (I tried to run them for Arduino "due" board and they pass, afaics they are not flashing anything to the board as we do on Zephyr tests...).
   
   ```
   >>> import tvm.micro.project as p
   >>> prj  = p.generate_project_from_mlf("/home/gromero/git/tvm/apps/microtvm/arduino/template_project","/tmp/4300","/home/gromero/git/tvm/python/tvm/driver/tvmc/sine.tar", { "project_type": "host_driven", "arduino_board": "due", "arduino_cli_cmd": "/home/gromero/bin/arduino-cli" } )
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 199, in generate_project_from_mlf
       return template.generate_project_from_mlf(str(mlf_path), str(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 122, in generate_project_from_mlf
       return GeneratedProject.from_directory(project_dir, options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 68, in from_directory
       return cls(client.instantiate_from_dir(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 75, in __init__
       raise TemplateProjectError()
   tvm.micro.project.TemplateProjectError
   >>> 
    ```


-- 
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] gromero commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   > @gromero is it possible to replicate the scenario in a test?
   
   @Mousius oh I forgot to share a repro (thought of it and then forgot it just after):
   
   ```
   >>> import tvm.micro.project as p
   >>> prj  = p.generate_project_from_mlf("/home/gromero/git/tvm/apps/microtvm/arduino/template_project","/tmp/4300","/home/gromero/git/tvm/python/tvm/driver/tvmc/sine.tar", { "project_type": "host_driven", "arduino_board": "due", "arduino_cli_cmd": "/home/gromero/bin/arduino-cli" } )
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 199, in generate_project_from_mlf
       return template.generate_project_from_mlf(str(mlf_path), str(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 122, in generate_project_from_mlf
       return GeneratedProject.from_directory(project_dir, options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 68, in from_directory
       return cls(client.instantiate_from_dir(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 75, in __init__
       raise TemplateProjectError()
   tvm.micro.project.TemplateProjectError
   >>> 
   ```


-- 
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] gromero commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   @guberti Thanks for the review. Yes, please, if you can crack it it would cool.


-- 
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] gromero edited a comment on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

Posted by GitBox <gi...@apache.org>.
gromero edited a comment on pull request #9320:
URL: https://github.com/apache/tvm/pull/9320#issuecomment-949975658


   @guberti Thanks for the review. Yes, please, if you can ~crack~ take a crack at writing that it would be cool.


-- 
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] gromero removed a comment on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

Posted by GitBox <gi...@apache.org>.
gromero removed a comment on pull request #9320:
URL: https://github.com/apache/tvm/pull/9320#issuecomment-946786526


   > @gromero is it possible to replicate the scenario in a test?
   
   @Mousius oh I forgot to share a repro (thought of it and then forgot it just after):
   
   ```
   >>> import tvm.micro.project as p
   >>> prj  = p.generate_project_from_mlf("/home/gromero/git/tvm/apps/microtvm/arduino/template_project","/tmp/4300","/home/gromero/git/tvm/python/tvm/driver/tvmc/sine.tar", { "project_type": "host_driven", "arduino_board": "due", "arduino_cli_cmd": "/home/gromero/bin/arduino-cli" } )
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 199, in generate_project_from_mlf
       return template.generate_project_from_mlf(str(mlf_path), str(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 122, in generate_project_from_mlf
       return GeneratedProject.from_directory(project_dir, options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 68, in from_directory
       return cls(client.instantiate_from_dir(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 75, in __init__
       raise TemplateProjectError()
   tvm.micro.project.TemplateProjectError
   >>> 
   ```


-- 
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] gromero commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   > @gromero is it possible to replicate the scenario in a test?
   
   @Mousius Yes, below is a repro. So all a test needs to do is  generate a project dir based on Arduino default template. I haven't looked closely why current tests don't catch it.
   
   ```
   >>> import tvm.micro.project as p
   >>> prj  = p.generate_project_from_mlf("/home/gromero/git/tvm/apps/microtvm/arduino/template_project","/tmp/4300","/home/gromero/git/tvm/python/tvm/driver/tvmc/sine.tar", { "project_type": "host_driven", "arduino_board": "due", "arduino_cli_cmd": "/home/gromero/bin/arduino-cli" } )
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 199, in generate_project_from_mlf
       return template.generate_project_from_mlf(str(mlf_path), str(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 122, in generate_project_from_mlf
       return GeneratedProject.from_directory(project_dir, options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 68, in from_directory
       return cls(client.instantiate_from_dir(project_dir), options)
     File "/home/gromero/git/tvm/python/tvm/micro/project.py", line 75, in __init__
       raise TemplateProjectError()
   tvm.micro.project.TemplateProjectError
   >>> 
    ```


-- 
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] gromero edited a comment on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

Posted by GitBox <gi...@apache.org>.
gromero edited a comment on pull request #9320:
URL: https://github.com/apache/tvm/pull/9320#issuecomment-949975658


   @guberti Thanks for the review. Yes, please, if you can ~crack~ take a crack at writing that it would cool.


-- 
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] gromero edited a comment on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

Posted by GitBox <gi...@apache.org>.
gromero edited a comment on pull request #9320:
URL: https://github.com/apache/tvm/pull/9320#issuecomment-949975658


   @guberti Thanks for the review. Yes, please, if you can ~crack~ take a crack at writing it it would cool.


-- 
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] Mousius commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   @gromero is it possible to replicate the scenario in 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] gromero commented on pull request #9320: [microTVM] Arduino: Fix MLF archive filename in generated project dir

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


   > LGTM - I assume @guberti will send a test case in a separate PR, so we can merge this for now to fix the issue.
   
   @leandron Yeah that's right, it will be a follow-on PR. Thanks for the review :+1: 


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