Hello,
I am trying to debug custom LSTM PTQ using torch.ao.ns._numeric_suite_fx
.
This is the code after custom quantization:
# extract weight pairs
weight_comparison = ns.extract_weights('a', m, 'b', converted)
ns.extend_logger_results_with_comparison(
weight_comparison, 'a', 'b', torch.ao.ns.fx.utils.compute_sqnr,
'sqnr')
I got this error:
raise GraphMatchingException(msg)
torch.ao.ns.fx.graph_matcher.GraphMatchingException:
The subgraphs
(NSSubgraph(start_node=my_lstm, end_node=my_lstm, base_op_node=my_lstm), <class 'torch.nn.modules.rnn.LSTM'>) and
(NSSubgraph(start_node=my_lstm, end_node=my_lstm, base_op_node=my_lstm), <class 'torch.ao.nn.quantized.modules.rnn.LSTM'>)
are not related. Please ensure that the two models you pass in have the same number
of subgraphs, and each pair of subgraphs is related to each other.
Does this mean that custom LSTM quantization is not supported for those APIs?
Or I should manually match quantized.LSTM and nn.LSTM ops?