Skip to content
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

Update Torch to ONNX export in conformance #2269

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

kshpv
Copy link
Collaborator

@kshpv kshpv commented Nov 15, 2023

Changes

Do constant folding while exporting to ONNX from Torch

Reason for changes

Conformance test regressgion of ONNX after updating torch to 2.1
Model graphs are updated and contain BatchNorm. Therefore bias locates no more as Conv attribute but in BatchNorm layer. It leads to not applying FBC and BC algorithms to these biases.

Related tickets

125203

Tests

N/A

@kshpv kshpv requested a review from a team as a code owner November 15, 2023 11:45
@github-actions github-actions bot added the NNCF PTQ Pull requests that updates NNCF PTQ label Nov 15, 2023
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Merging #2269 (1f7fef7) into develop (8efd04a) will increase coverage by 0.03%.
Report is 3 commits behind head on develop.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2269      +/-   ##
===========================================
+ Coverage    90.72%   90.75%   +0.03%     
===========================================
  Files          485      485              
  Lines        43722    43715       -7     
===========================================
+ Hits         39665    39673       +8     
+ Misses        4057     4042      -15     
Flag Coverage Δ
COMMON 15.82% <ø> (+<0.01%) ⬆️
ONNX 33.83% <ø> (+<0.01%) ⬆️
OPENVINO 38.62% <ø> (+0.04%) ⬆️
TENSORFLOW 30.04% <ø> (+<0.01%) ⬆️
TORCH 62.72% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

@vshampor
Copy link
Contributor

Since both representations are possible, shouldn't we instead modify the BC/FBC algos, or NNCFGraph creation from ONNX models to work correctly in both cases?

@kshpv
Copy link
Collaborator Author

kshpv commented Nov 15, 2023

Since both representations are possible, shouldn't we instead modify the BC/FBC algos, or NNCFGraph creation from ONNX models to work correctly in both cases?

Sure

@kshpv
Copy link
Collaborator Author

kshpv commented Nov 17, 2023

Conformance job 214. According to results ONNX problems were fixed. Also, some problems on develop was faced for Torch
@AlexanderDokuchaev please confirm

@AlexanderDokuchaev
Copy link
Collaborator

Conformance job 214. According to results ONNX problems were fixed. Also, some problems on develop was faced for Torch @AlexanderDokuchaev please confirm

Yes, ONNX works, but dont forget to update reference metrics. TORCH backend falls by know issue (ticker 125357)

@kshpv
Copy link
Collaborator Author

kshpv commented Nov 17, 2023

Conformance job 214. According to results ONNX problems were fixed. Also, some problems on develop was faced for Torch @AlexanderDokuchaev please confirm

Yes, ONNX works, but dont forget to update reference metrics. TORCH backend falls by know issue (ticker 125357)

Done

Copy link
Contributor

@alexsu52 alexsu52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KodiaqQ KodiaqQ merged commit 0c7a8d5 into openvinotoolkit:develop Nov 17, 2023
9 checks passed
@kshpv kshpv deleted the export_fix_conformance branch January 17, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NNCF PTQ Pull requests that updates NNCF PTQ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants