gromero commented on issue #10270:
URL: https://github.com/apache/tvm/issues/10270#issuecomment-1074271042


   > > Since you've done all the analysis and also reported it, are you 
interested in sending a PR to fix it? I like the solution of using a simple 
dict map and I think such a map could be a global as CMAKE_BOOL_MAP and defined 
right above class Handle(), for instance so in the future other options can 
take advantage of it too
   > 
   > I would be happy to create a PR for this. However I think that the main 
issue is not fully solved by your suggested solution as it would only resolve 
boolean options correctly while options of type `int` would still be accessed 
as string. So we should either actually make use of the type hints in 
`server.ProjectOption` to implicitly convert those options to the chosen type 
or alternatively mention somewhere, that the user has to parse/cast them 
manually.
   > 
   > What do you think about this?
   
   Yes, my opinion is that only `warning_as_error` option needs to get fixed. 
The reason is because, as you said precisely, the `type` metadatum is provided 
as a *hint* to the Project API users, like TVMC (which current is using that to 
handle the boolean / flag options). So it's TVMC's duty to, for instance, 
ensure that only int values are passed to  `gdbserver_port` option. Currently 
we don't enforce it so you can pass `blah` or anything else invalid as the GDB 
port. Anyways, it should be handled at the Project API user side  (e.g. TVMC), 
not on the server side. As reference, please see (and the `Motivation` section 
as well) 
[RFC-0020](https://github.com/apache/tvm-rfcs/blob/main/rfcs/0020-project_api_extend_metadata.md#on-type-metadatum)
   
   I'm cc:ing @areusch in case he has got another suggestion about it.
   
   
   > Another short question: What do you mean with `class Handle()`?
   
   ah, sorry (it's `class Handler()`, not `Handle()`). I was just saying that a 
dict for the map could be defined as a global (like 
https://github.com/apache/tvm/blob/main/apps/microtvm/zephyr/template_project/microtvm_api_server.py#L91)
 right above this line: 
https://github.com/apache/tvm/blob/main/apps/microtvm/zephyr/template_project/microtvm_api_server.py#L336


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to