[Examples][FX] WC Example for TorchFX Backend#3467
Merged
alexsu52 merged 40 commits intoopenvinotoolkit:developfrom Jul 25, 2025
Merged
[Examples][FX] WC Example for TorchFX Backend#3467alexsu52 merged 40 commits intoopenvinotoolkit:developfrom
alexsu52 merged 40 commits intoopenvinotoolkit:developfrom
Conversation
Collaborator
|
Please add new tests to https://github.com/openvinotoolkit/nncf/blob/develop/tests/cross_fw/examples/.test_durations |
Collaborator
Author
Done! |
alexsu52
suggested changes
Apr 30, 2025
alexsu52
reviewed
Apr 30, 2025
AlexanderDokuchaev
requested changes
May 20, 2025
AlexanderDokuchaev
added a commit
that referenced
this pull request
May 28, 2025
### Changes This PR achieves the following: 1. Fix an issue faced when using openvino nightly Ref. 167462 2. Fix performance issue where compressed FX models in conformance were running slow. Fixes discovered when working on #3467 allow the compressed FX model to run faster. ### Reason for changes To resolve errors with openvino nightly and make the WC conformance test run faster. ### Related tickets 167462 Category | Job | Status | Job Number | Notes -- | -- | -- | -- | -- WC Conformance | Nightly | Pass | 104 | --------- Co-authored-by: Alexander Dokuchaev <alexander.dokuchaev@intel.com>
AlexanderDokuchaev
approved these changes
Jun 20, 2025
Comment on lines
+88
to
+90
| """ | ||
| Convert a `PreTrainedModel` into an exportable module and export it using `torch.export` | ||
| or `torch._export.capture_pre_autograd_graph`. |
Collaborator
There was a problem hiding this comment.
Please add parameters and return statements to the docstring
Co-authored-by: Daniil Lyakhov <daniil.lyakhov@intel.com>
daniil-lyakhov
approved these changes
Jun 24, 2025
Use chat template for the prompt as expected by the model
alexsu52
reviewed
Jul 24, 2025
Comment on lines
+72
to
+74
| prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) | ||
|
|
||
| input_ids = tokenizer(prompt, return_tensors="pt") |
Contributor
There was a problem hiding this comment.
Suggested change
| prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) | |
| input_ids = tokenizer(prompt, return_tensors="pt") | |
| input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True) |
alexsu52
approved these changes
Jul 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Add example script for TorchFX backend in
examples/.Reason for changes
This is to show a sample script for applying WC to LLMs which are exported using
torch.export()Tests