-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NNCF][BC] Add test case with depthwise/transpose convolutions to template and backend specific tests #3004
[NNCF][BC] Add test case with depthwise/transpose convolutions to template and backend specific tests #3004
Conversation
…pes are needed for these specific tests
Hi @daniil-lyakhov, In the checks, the The reference graph for Unet model has the old Nx Digraph which leads to a failure due to incompatible corresponding node names. The test compares the new nncf_graph structure now with the old reference nx digraph. In my local repo, I have updated it to the new nx digraph and the test passes. Is this alright? Can I push this change to my PR? |
Hi @rk119, please update the reference unet graph. Unet model has transpose convs, after your changes this transform convs and their biases are being separated. Test models fails were expected. And please fix pre-commit tests, thanks! |
Hi @daniil-lyakhov, I apologize if this seems redundant, but I would be grateful for your help with this issue I'm facing. The following is the implementation of the Transpose Test model with just one convolution layer , as you are aware:
In the Torch FX implementation of map_references, the parameters passed into this function are the Torch FX model in test run 1: Torch FX model in test run 2: I have pointed out the node name we are using as the key to the dictionary, with corresponding bias values. The map_references function retrieves the Test run 1: Test run 2: They are the same. The convolution node names after the first convolution have indexes after conv_2d_, starting from 1 and increasing incrementally. Hence, we obtain the index values using a simple algorithm. However, in the OpenVINO backend, it is different. The first convolution node I am trying to access has a preceding index after the convolution name, but there is no discernible pattern and the indexes are inconsistent. I run the same test multiple times, and here's the model: Test run 1: Another test run: The same Transpose Convolution model produces different node names in different runs of the same test file. I am still struggling to find a pattern to implement map_references for OpenVINO, where I can use an algorithm to obtain the index after the node name—unfortunately, I can't. However, I have two solutions to tackle this which works: Solution 1: I can keep the map_references implementation as it is And access the exact node name by retrieving the first node with the
This works. Solution 2: Add another argument to map_references by passing the converted model to access the node name directly for the OpenVINO Transpose Conv model:
These are the two solutions I can propose for now. I would be grateful if you could guide me on this. Thank you! Another note: This further extends to not being able to test Transpose Conv Test Model in test_verify_collected_stat_inputs_map since the node name in the converted In conclusion, the checks fail for this test since the converted model has different indexes for the Convolution name for Transpose with no consistent pattern for me to recognize atleast. |
Hi @rk119, |
Alright! Just did.
Haha alright yes. :) |
Transposed conv BC tests for OV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, thank you!
@alexsu52, please merge |
@kshpv please, take a look at ONNX part. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rk119,
Thank you for your contribution!
I noticed that you added FBC tests for Depthwise and Transpose cases. However, FBC does not apply corrections for these cases, so the proposed tests do not have any effect. I suggest removing these tests to avoid any confusion.
Ohhh alright. I'll remove them. Thank you for clarifying :) |
…nncf into add_test_case_to_template
Changes
Added simple Depthwise and Transpose Convolution models in
tests/cross_fw/test_templates/helpers.py
.Updated
map_references
for Torch FX backend to assign the right reference node names for model classes Depthwise and Transpose Convolutions.Added
ONNXConvolutionTransposeMetatype
into the list of OPERATIONS_WITH_BIAS for ONNX.Added the missing target for Transpose Conv in
transformations.py
for Torch FX in the function_is_conv
.Added
OVConvolutionBackpropDataMetatype
into the list of OPERATIONS_WITH_BIAS for OpenVino backendReplaced the unet graph in quantized reference graphs for FX backend.
Extra Changes
tests/openvino/native/test_bias_correction.py
for Transpose Convolution node name and accommodate for the changes in the name after each run.Closes issue
#2916