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

🐛 [Bug] Missing directory and file in FX path (Python only) installation #1976

Closed
HolyWu opened this issue Jun 3, 2023 · 6 comments · Fixed by #2056
Closed

🐛 [Bug] Missing directory and file in FX path (Python only) installation #1976

HolyWu opened this issue Jun 3, 2023 · 6 comments · Fixed by #2056
Assignees
Labels
bug Something isn't working

Comments

@HolyWu
Copy link
Contributor

HolyWu commented Jun 3, 2023

Bug Description

  1. torch_tensorrt.fx.converters.impl was not added to the packages and package_dir list, hence the impl directory was not installed.
  2. _Input.py was not installed even though you had added it to package_data because torch_tensorrt was not in the packages list in FX_ONLY. Instead, you have to use py_modules to copy modules that aren't part of a package.
  3. _Input.py imported _enums.py which was also not installed in FX_ONLY. And _enums.py imported stuff from torch_tensorrt._C which was unavailable in FX_ONLY.
  4. torch_tensorrt/dynamo/__init__.py imported compile from torch_tensorrt/dynamo/backend, but the backend directory was not installed in FX_ONLY.

To Reproduce

python3 setup.py install --fx-only

Environment

  • Torch-TensorRT Version (e.g. 1.0.0): 1.4.0
  • PyTorch Version (e.g. 1.0): 2.0.1+cu118
  • CPU Architecture: x86_64
  • OS (e.g., Linux): Windows
  • How you installed PyTorch (conda, pip, libtorch, source): pip
  • Build command you used (if compiling from source):
  • Are you using local sources or building from archives:
  • Python version: 3.11.3
  • CUDA version: 11.8
  • GPU models and configuration:
  • Any other relevant information:
@HolyWu HolyWu added the bug Something isn't working label Jun 3, 2023
@gs-olive
Copy link
Collaborator

gs-olive commented Jun 7, 2023

Thank you for reporting this - regarding the Dynamo comments, our torch_tensorrt.dynamo path still has a few C++ dependencies, and so it is currently not able to be imported without the full python setup.py install, though we have open issues to resolve this: #1943, #1993.

@apbose
Copy link
Collaborator

apbose commented Jun 20, 2023

Hi, thanks for reporting the issue. I wanted to clarify. I have added torch_tensorrt.fx.converters.impl to package list and I do see it in the site_packages of torch_tensorrt installed, however even if I do not mention the torch_tensorrt.fx.converters.impl in package list, the impl is still installed. So I wanted to clarify on what issue you are facing currently. Thanks!

@HolyWu
Copy link
Contributor Author

HolyWu commented Jun 20, 2023

@apbose
Copy link
Collaborator

apbose commented Jun 23, 2023

Ok, looking into this.

@apbose
Copy link
Collaborator

apbose commented Jul 10, 2023

Thanks for the repo steps above.
So when I install using python setup.py install --fx-only --release and do import torch_tensorrt.fx it shows ModuleNotFoundError: No module named 'torch_tensorrt._C. As mentioned earlier since dynamo still has C++ dependencies these won't be imported until we do the full python setup.py install

@apbose
Copy link
Collaborator

apbose commented Jul 17, 2023

From torch_tensorrt._compile import * ts package is getting imported from torch_tensorrt/_compile.py .
--fx-only is not proper at the moment. PEP517- #2056 changes should address the cross C++ and python dependencies

@narendasan narendasan linked a pull request Jul 17, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants