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

[PT] bump torch to 2.5.1 #3037

Merged
merged 56 commits into from
Nov 8, 2024
Merged

Conversation

anzr299
Copy link
Collaborator

@anzr299 anzr299 commented Oct 24, 2024

Changes

  1. Change Torch Version from 2.4.0 -> 2.5.0
  2. Update nncf/experimental/torch/fx/transformations.py for merging bias and linear/conv nodes to eliminate dead subgraph and nodes. Created _get_connected_nodes() to get the list of nodes directly or indirectly connected to the output node.
  3. Import torchvision in NNCF patching for jit.
  4. Update MAP_BACKEND_PACKAGES in tests/cross_fw/shared/helpers.py to include torch and torchvision.

Reason for changes

  1. Migration
  2. Since the dead subgraphs and nodes were not being removed from the model after merging bias and conv/linear nodes, Only nodes which are directly or indirectly connected to the output node were kept.
  3. This was done because import order with torchvision also affected the operators.
  4. After change 3, it is required to pass test_force_cuda_build in tests/torch/test_extensions_build.py.

Related tickets

#3036

Tests

test_get_connected_nodes() is added in tests/torch/fx/test_model_transformer.py to test _get_connected_nodes() function.

Constrains

Torch FX tests for windows are skipped (CVS-156781) since torch._export.capture_pre_autograd_graph does not support windows in torch 2.5

@anzr299 anzr299 requested a review from a team as a code owner October 24, 2024 08:05
@github-actions github-actions bot added documentation Improvements or additions to documentation NNCF PT Pull requests that updates NNCF PyTorch labels Oct 24, 2024
@anzr299 anzr299 changed the title [PT] bump torch 2.4.0 [PT] bump torch to 2.5.0 Oct 24, 2024
README.md Outdated Show resolved Hide resolved
@daniil-lyakhov daniil-lyakhov self-requested a review November 4, 2024 10:49
.gitignore Outdated Show resolved Hide resolved
docs/Installation.md Outdated Show resolved Hide resolved
@anzr299 anzr299 requested a review from alexsu52 November 6, 2024 07:40
Copy link
Collaborator

@MaximProshin MaximProshin left a comment

Choose a reason for hiding this comment

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

@anzr299 , please list all the executed jobs with PT 2.5.0 and status.
Have you considered 2.5.1?

@anzr299
Copy link
Collaborator Author

anzr299 commented Nov 7, 2024

Consideration for Torch 2.5.1: Updated to torch 2.5.1

Status of Jobs

Category Job Status Job Number Reason
Nightly install_pt_cpu Pass 600  
Nightly install_pt_gpu Pass 598  
Nightly torch_nightly Pass 376  
Nightly e2e_pytorch_full Pass 874  
Nightly/Windows precommit_torch_cpu Pass 498  
Nightly/Windows install_torch_cpu Pass 485  
Nightly/Windows install_torch_gpu Pass 32 No history for this build; Can assume does not work for develop
Nightly/Windows precommit_tf Pass 456  
Nightly/Windows precommit_openvino Pass 468  
Nightly/Windows precommit_onnx Pass 459  
Nightly/Windows precommit_common Pass 79  
Manual post_training_quantization Pass 539 failures don't relate to torch 2.5.0
Manual post_training_weights_compression Pass 239  

@AlexanderDokuchaev AlexanderDokuchaev merged commit 058dce6 into openvinotoolkit:develop Nov 8, 2024
14 checks passed
@anzr299 anzr299 changed the title [PT] bump torch to 2.5.0 [PT] bump torch to 2.5.1 Nov 10, 2024
nikita-savelyevv pushed a commit to nikita-savelyevv/nncf that referenced this pull request Dec 11, 2024
### Changes

1. Change Torch Version from 2.4.0 -> 2.5.0
2. Update `nncf/experimental/torch/fx/transformations.py` for merging
bias and linear/conv nodes to eliminate dead subgraph and nodes. Created
`_get_connected_nodes()` to get the list of nodes directly or indirectly
connected to the output node.
3. Import `torchvision` in NNCF patching for jit.
4. Update `MAP_BACKEND_PACKAGES` in `tests/cross_fw/shared/helpers.py`
to include `torch` and `torchvision`.

### Reason for changes

1. Migration
2. Since the dead subgraphs and nodes were not being removed from the
model after merging bias and conv/linear nodes, Only nodes which are
directly or indirectly connected to the output node were kept.
3. This was done because import order with torchvision also affected the
operators.
4. After change 3, it is required to pass `test_force_cuda_build` in
`tests/torch/test_extensions_build.py`.

### Related tickets

openvinotoolkit#3036

### Tests

`test_get_connected_nodes()` is added in
`tests/torch/fx/test_model_transformer.py` to test
`_get_connected_nodes()` function.

### Constrains

Torch FX tests for windows are skipped (CVS-156781) since
`torch._export.capture_pre_autograd_graph` does not support windows in
torch 2.5

---------

Co-authored-by: Alexander Dokuchaev <alexander.dokuchaev@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Public API-impacting changes Code Freeze documentation Improvements or additions to documentation experimental NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants