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

remove torchvision as dependency #3158

Closed
wants to merge 5 commits into from
Closed

Conversation

lanluo-nvidia
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@lanluo-nvidia lanluo-nvidia added the WIP Work is in progress, pull request should not be merged yet label Sep 11, 2024
@lanluo-nvidia lanluo-nvidia self-assigned this Sep 11, 2024
@github-actions github-actions bot added component: tests Issues re: Tests component: api [Python] Issues re: Python API labels Sep 11, 2024
@lanluo-nvidia lanluo-nvidia requested review from narendasan and removed request for peri044 September 15, 2024 16:30
@HolyWu
Copy link
Contributor

HolyWu commented Sep 16, 2024

Note that the latest nightly torchvision has depended on torch 2.6.0.dev, so installing torchtrt wheel will fail because it still depends on torch 2.5.0.dev.

@@ -12,3 +12,6 @@ transformers==4.40.2
# TODO @lanlao-nvidia Renable when modelopt can be install properly to run the tests
# "nvidia-modelopt[all]">=0.16.1,<0.17.0
--extra-index-url https://pypi.nvidia.com
torchvision>=0.20.0.dev,<0.21.0
--extra-index-url https://download.pytorch.org/whl/nightly/cu124
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this extra-index-url is redundant. We already have INDEX_URL defined in install-torch-tensorrt.sh which has templated channel and cu_version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, It is redundant.
in the install-torch-tensorrt.sh it is templated with channel and cu_version.
I still want to keep this --extra-index-url here just in case that developer run:
python -m pip install --pre -r tests/py/requirements.txt in their local environment to test

@narendasan
Copy link
Collaborator

How many tests are getting altered from this changed? Are there tests where we could just use a simple network that we host and get similar impact for testing and not have to disable it?

I think we really only care about torchvision models in cases where we specifically want to test that model architecture (so we should have at least 1 resnet, 1 bert, 1 vit test) or we need real weights for some reason

@lanluo-nvidia
Copy link
Collaborator Author

Note that the latest nightly torchvision has depended on torch 2.6.0.dev, so installing torchtrt wheel will fail because it still depends on torch 2.5.0.dev.

we have specified the torchvison version so that make sure it is compatible with torch version in the test.

How many tests are getting altered from this changed? Are there tests where we could just use a simple network that we host and get similar impact for testing and not have to disable it?

I think we really only care about torchvision models in cases where we specifically want to test that model architecture (so we should have at least 1 resnet, 1 bert, 1 vit test) or we need real weights for some reason

@narendasan
There are total 30 testcases which uses torchvision.resnet18(28 testcases) torchvision.mobilenet_v2(2 testcases) models
for the Bertmodel we used it from transformers, did not use torchvision.

I can see most times we just use torchvision.resnet18 to test our features, it can be replaced with other simple network.
For example:
test_engine_cache.py we have 5 testcases uses resnet18 model to test engine cache related features
test_model_refit.py
we have 9 testcases use resnet18 model to test our refit related feature

I think for test_models.py is where we should actually use these torchvision.resnet18 and movilenet_v2 models for testing.

@HolyWu
Copy link
Contributor

HolyWu commented Sep 17, 2024

Be aware that all tests were failed to run even though they all showed green. https://github.com/pytorch/TensorRT/actions/runs/10887326997/job/30210220619?pr=3158#step:12:522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: tests Issues re: Tests WIP Work is in progress, pull request should not be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants