nncf icon indicating copy to clipboard operation
nncf copied to clipboard

[Torch FX] Support for ExportedProgram from torch.export.export in Weights Compression

Open anzr299 opened this issue 1 year ago • 1 comments

🚀 Feature request

Currently, the Torch FX backend supports FX representation(torch.fx.GraphModule() object) extracted using capture_pre_autograd_graph() which has a slightly different representation and is a deprecated feature. This feature request is to compress weights in torch FX graphs extracted using torch.export.export() instead of capture_pre_autograd_graph()

Feature Use Case

The FX model returned from torch.export.export() can also be supported in weights compression along with capture_pre_autograd_graph() due to the latter being deprecated in the future.

Are you going to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

anzr299 avatar Sep 25 '24 06:09 anzr299

@anzr299, let's migrate to torch.export.export(...).module() first. It returns GraphModule, is supported for the target model scope and improves metrics of the swin_v2_s model. #2990

daniil-lyakhov avatar Sep 25 '24 16:09 daniil-lyakhov

Decided to move to the torch.export.export_for_training PR https://github.com/openvinotoolkit/nncf/pull/3075

daniil-lyakhov avatar Nov 25 '24 15:11 daniil-lyakhov