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 2020/11/07 20:17:15 UTC

[GitHub] [incubator-tvm] merrymercy opened a new issue #6878: Disable meta data when printing TIR

merrymercy opened a new issue #6878:
URL: https://github.com/apache/incubator-tvm/issues/6878


   Recently I found TVM will print meta when I do 
   ```
   print(tvm.lower(s, [A, B, C], simple_mode=True))
   ```
   
   Here is an example output in the tutorial website (https://tvm.apache.org/docs/tutorials/language/schedule_primitives.html)
   ```
   #[version = "0.0.5"]
   primfn(A_1: handle, B_1: handle, C_1: handle) -> ()
     attr = {"global_symbol": "main", "tir.noalias": True}
     buffers = {C: Buffer(C_2: Pointer(float32), float32, [m: int32, n: int32], [stride: int32, stride_1: int32], type="auto"),
                B: Buffer(B_2: Pointer(float32), float32, [m, n], [stride_2: int32, stride_3: int32], type="auto"),
                A: Buffer(A_2: Pointer(float32), float32, [m, n], [stride_4: int32, stride_5: int32], type="auto")}
     buffer_map = {A_1: A, B_1: B, C_1: C} {
     for (i: int32, 0, m) {
       for (j: int32, 0, n) {
         C_2[((i*stride) + (j*stride_1))] = ((float32*)A_2[((i*stride_4) + (j*stride_5))]*(float32*)B_2[((i*stride_2) + (j*stride_3))])
       }
     }
   }
   
   #[metadata]
   {
     "root": 1,
     "nodes": [
       {
         "type_key": ""
       },
       {
         "type_key": "Map",
         "keys": [
           "IntImm"
         ],
         "data": [2]
       },
       {
         "type_key": "Array",
         "data": [3]
       },
       {
         "type_key": "IntImm",
         "attrs": {
           "dtype": "bool",
           "value": "1"
         }
       }
     ],
     "b64ndarrays": [],
     "attrs": {"tvm_version": "0.8.dev0"}
   }
   ```
   
   I found this very annoying.  Why do we print it? Can we disable it for this use case by default?
   cc @tqchen @spectrometerHBH @jroesch @junrushao1994 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] tqchen commented on issue #6878: Do not show meta data when printing TIR

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #6878:
URL: https://github.com/apache/incubator-tvm/issues/6878#issuecomment-723506521


   I agree that for repr and str we should turn off the meta data since they are not strictly required


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] junrushao1994 commented on issue #6878: Do not show meta data when printing TIR

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on issue #6878:
URL: https://github.com/apache/incubator-tvm/issues/6878#issuecomment-723490419


   You may slightly these lines: https://github.com/apache/incubator-tvm/blob/main/python/tvm/ir/module.py#L253-L258, adding `show_meta_data=False` to `self.astext`


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] merrymercy commented on issue #6878: Do not show meta data when printing TIR

Posted by GitBox <gi...@apache.org>.
merrymercy commented on issue #6878:
URL: https://github.com/apache/incubator-tvm/issues/6878#issuecomment-723521610


   Fixed by #6881


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] merrymercy closed issue #6878: Do not show meta data when printing TIR

Posted by GitBox <gi...@apache.org>.
merrymercy closed issue #6878:
URL: https://github.com/apache/incubator-tvm/issues/6878


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] junrushao1994 commented on issue #6878: Do not show meta data when printing TIR

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on issue #6878:
URL: https://github.com/apache/incubator-tvm/issues/6878#issuecomment-723490592


   @jroesch shall we turn off the `show_meta_data` in `IRModule.__str__` and `IRModule.__repr__`? If so, @merrymercy would you mind send a PR?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org