arina-grovety commented on PR #13212:
URL: https://github.com/apache/tvm/pull/13212#issuecomment-1308844686

   
   > 
   > The option for printing the operators currently seems very specific to the 
NPU, I'm wondering if we would see more benefit adding this as a generic option 
within TVMC without too many changes? Not only would it benefit other targets, 
it would make the option more robust and easier to find from a user POV. Its 
currently possible to save the partitioned graph in TVMC using 
`--dump-code="relay"`, perhaps `print_operators_offloading` could be called at 
a similar point (given a command line argument such as `--dump-offloads`) 
rather than from within the NPU specific code, WDYT?
   > 
   
   Hi @lhutton1, 
   
   Do you propose to implement this function for all the targets? Or just add a 
general compiler option leaving the implementation currently only in the 
ethos-u backend? 
   Right now, this function is specific to ethos-u and is handled in the 
ethos-u backend.
   As far as I'm concerned it won't be a problem to implement the function for 
all targets, but of course I could be wrong.
   
   Here is an example how the output would look like if model is compiled for 
the target "llvm":
      'generic    <-   %0 = qnn.conv2d(%tfl.quantize, %v_param_1, ...'
      'generic    <-   %1 = nn.bias_add(%0, %v_param_2, axis=3);'
      'generic    <-   %2 = qnn.requantize(%1, meta[relay.Constant]...'
   
   And for targets "ethos-u,cmsis-nn,c"
       'ethos-u    <- ethos-u.qnn_conv2d'
       'ethos-u    <-        %204 = qnn.conv2d(%203, %v_param_105, -128, 0, 
0.0235294f, ...'
       'ethos-u    <-        %205 = nn.bias_add(%204, %v_param_106, axis=3);'
       'ethos-u    <-        %206 = qnn.requantize(%205, 
meta[relay.Constant][105], 0, ...'
       'ethos-u    <- ethos-u.reshape'
       'ethos-u    <-        %207 = reshape(%206, newshape=[1, 1001]);'
       'cmsis-nn   <- cmsis-nn.qnn_softmax'
       'cmsis-nn   <-        %208 = qnn.dequantize(%207, 0.0775722f, -61);'
       'cmsis-nn   <-        %209 = nn.softmax(%208);'
       'cmsis-nn   <-        qnn.quantize(%209, 0.00390625f, -128, 
out_dtype="int8")'


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