Lunderberg commented on pull request #8587:
URL: https://github.com/apache/tvm/pull/8587#issuecomment-889396661


   > Json-style target string parsing is supported as the canonical way for 
target creation and json export is supported using the `export` function 
(though right now the export result is not pure json, it's actually a tvm Map 
object). In the long term, I am in favor of using json exclusively for `target 
-> str` conversion.
   
   Definitely agreed, long-term it's better to go through a standard format.  I 
played around a bit with converting the tvm `Map` to a json string, but while 
it wasn't too hard to get something working for my test cases, getting it fully 
functional and clean felt like it would take longer than a quick edit.  (And 
I'd probably have wanted to switch to a C++ JSON parser to avoid jumping 
between languages too often, which would have added its own issues.)
    
   > Meanwhile, IIRC we are using the current `str` function (`target->str`) 
for compatibility with AutoTVM and Ansor (AutoScheduling). IMHO, If we want to 
extend the argument parsing to escape strings, I would suggest that we keep the 
`str` function the same, and work on parsing and `export` function first (with 
compatibility for `str` function output). Other than that, I'm not aware of any 
other potential breakage. I think Junru might add to that.
   
   Yeah, the compatibility was what I was most concerned about.  I wanted to 
update the `.str()` method itself, rather than introducing a new function such 
as `.json()`, because that's what gets called elsewhere.  The updated 
parser/serializer should maintain the exact same string output for attribute 
keys without embedded spaces, but "should" is always a bit of a dangerous word.
   


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