Skip to content

Cross compile guard #3486

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Cross compile guard #3486

wants to merge 4 commits into from

Conversation

apbose
Copy link
Collaborator

@apbose apbose commented Apr 22, 2025

The PR addresses the following-

  1. Enables the windows cross compile feature based on if libnvinfer_builder_resource_win.so.* is present
  2. Adds this as a decorator for the cross compile API
  3. This utility is also added for skip tests

@apbose apbose marked this pull request as draft April 22, 2025 18:27
@github-actions github-actions bot added component: tests Issues re: Tests component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Apr 22, 2025
@github-actions github-actions bot requested a review from gs-olive April 22, 2025 18:27
@apbose apbose marked this pull request as ready for review April 25, 2025 00:58
@apbose apbose requested a review from narendasan April 25, 2025 00:59

def check_cross_compile_trt_win_lib():
if sys.platform.startswith("linux"):
LINUX_PATHS = ["/usr/local/cuda-12.8/lib64", "/usr/lib", "/usr/lib64"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think this works generically, there needs to be a way to see of the library has been loaded aready

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took this code snippet from
py/torch_tensorrt/__init__.py where we check the tensorrt libs while importing torch_tensorrt. Since this is included in features I am putting this code snippet in _utils, where it checks if the _win*.so is present or not to be loaded via ctypes.CDLL ( can use ctypes.cdll.LoadLibrary() too). What is your thoughts on how to do this

@apbose apbose requested review from lanluo-nvidia and removed request for gs-olive April 25, 2025 19:02
@apbose apbose force-pushed the cross_compile_guard branch from 9a4f681 to ed8d559 Compare April 29, 2025 04:25
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

There are some changes that do not conform to Python style guidelines:

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: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants