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/09/07 16:46:39 UTC

[GitHub] [tvm] gromero opened a new pull request #8950: [microTVM] Add method to query template info without creating a project

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


   Add info() method to TemplateProject class so it's possible to query all
   available options for a given template project without creating a new
   one. This is necessary because TVMC will query the available options for
   a given template project to show them to the user so the user can use
   them to finally create a new project dir.
   
   That is also useful in general to query the available options for any
   project type. For example, one can query all boards available on the
   Zephyr platform with:
   
   import tvm.micro.project as project_api
   
   template = project_api.TemplateProject.from_directory(ZEPHYR_TEMPLATE_DIR)
   boards = template.info()["project_options"][8]["choices"]
   
   where 8 is refers to the "zephyr_board" option.
   
   Signed-off-by: Gustavo Romero <gu...@linaro.org>
   


-- 
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 #8950: [microTVM] Add method to query template info without creating a project

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



##########
File path: python/tvm/micro/project.py
##########
@@ -92,17 +92,16 @@ class TemplateProject:
     """Defines a glue interface to interact with a template project through the API Server."""
 
     @classmethod
-    def from_directory(cls, template_project_dir, options):
-        return cls(client.instantiate_from_dir(template_project_dir), options)
+    def from_directory(cls, template_project_dir):
+        return cls(client.instantiate_from_dir(template_project_dir))
 
-    def __init__(self, api_client, options):
+    def __init__(self, api_client):
         self._api_client = api_client
-        self._options = options
         self._info = self._api_client.server_info_query(__version__)
         if not self._info["is_template"]:
             raise NotATemplateProjectError()
 
-    def generate_project(self, graph_executor_factory, project_dir):
+    def generate_project(self, graph_executor_factory, project_dir, options):

Review comment:
       just noting for posterity that originally i didn't do this because i wanted all calls to Project API server to use the same options, but since there is just one call used with TemplateProject, and you might actually want to examine `self._info` before constructing `options`, this makes more sense to me




-- 
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] masahi merged pull request #8950: [microTVM] Add method to query template info without creating a project

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


   


-- 
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 a change in pull request #8950: [microTVM] Add method to query template info without creating a project

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



##########
File path: python/tvm/micro/project.py
##########
@@ -92,17 +92,16 @@ class TemplateProject:
     """Defines a glue interface to interact with a template project through the API Server."""
 
     @classmethod
-    def from_directory(cls, template_project_dir, options):
-        return cls(client.instantiate_from_dir(template_project_dir), options)
+    def from_directory(cls, template_project_dir):
+        return cls(client.instantiate_from_dir(template_project_dir))
 
-    def __init__(self, api_client, options):
+    def __init__(self, api_client):
         self._api_client = api_client
-        self._options = options
         self._info = self._api_client.server_info_query(__version__)
         if not self._info["is_template"]:
             raise NotATemplateProjectError()
 
-    def generate_project(self, graph_executor_factory, project_dir):
+    def generate_project(self, graph_executor_factory, project_dir, options):

Review comment:
       I see your point and that was exactly what I thought when I was going for that change. Thanks your comment, it really helps me to understand the design better and increases my confidence that I'm following the motivations behind it correctly :)




-- 
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 #8950: [microTVM] Add method to query template info without creating a project

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


   cc @mehrdadh @areusch , in the context of querying via the Project API the "choices" available on the platforms (zephyr, arduino, etc) - https://github.com/apache/tvm/pull/8940#discussion_r703094885 


-- 
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 a change in pull request #8950: [microTVM] Add method to query template info without creating a project

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



##########
File path: python/tvm/micro/project.py
##########
@@ -92,17 +92,16 @@ class TemplateProject:
     """Defines a glue interface to interact with a template project through the API Server."""
 
     @classmethod
-    def from_directory(cls, template_project_dir, options):
-        return cls(client.instantiate_from_dir(template_project_dir), options)
+    def from_directory(cls, template_project_dir):
+        return cls(client.instantiate_from_dir(template_project_dir))
 
-    def __init__(self, api_client, options):
+    def __init__(self, api_client):
         self._api_client = api_client
-        self._options = options
         self._info = self._api_client.server_info_query(__version__)
         if not self._info["is_template"]:
             raise NotATemplateProjectError()
 
-    def generate_project(self, graph_executor_factory, project_dir):
+    def generate_project(self, graph_executor_factory, project_dir, options):

Review comment:
       I see your point and that was exactly what I thought when I was going for that change. Thanks your comment, it really helps me to understand the design better and increase my confidence I'm following the motivations behind correctly :)




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