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

Require full compilation arg #3193

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Require full compilation arg #3193

merged 1 commit into from
Oct 18, 2024

Conversation

apbose
Copy link
Collaborator

@apbose apbose commented Sep 27, 2024

Addresses #3177

@apbose apbose self-assigned this Sep 27, 2024
@apbose apbose marked this pull request as draft September 27, 2024 18:21
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: torch_compile labels Sep 27, 2024
@apbose apbose marked this pull request as ready for review September 30, 2024 15:32
@@ -107,6 +107,8 @@ def _pretraced_backend(
torchtrt_inputs = prepare_inputs(
torch_inputs, disable_memory_format_check=True
)
if settings.require_full_compilation:
raise AssertionError("this argument is only applicable for ir=dynamo")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this isnt very clear since the backend will get called from torch.compile. You could instead throw a warning that requires_full_compilation does nothing for the tensorrt backend for torch.compile

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 changed this to a warning. But should there be some additional logic to make this argument invalid for the backend = "torch_tensorrt" since it would still be passed to the same partitioning code, and error out in case of torch.compile if there is a graph break

@apbose apbose force-pushed the require_full_compilation_arg branch 2 times, most recently from a654911 to 191f20f Compare October 7, 2024 17:09
@@ -107,6 +107,10 @@ def _pretraced_backend(
torchtrt_inputs = prepare_inputs(
torch_inputs, disable_memory_format_check=True
)
if settings.require_full_compilation:
logger.warning(
"req_full_compilation arg is not applicable for torch.compile with backend='torch_tensorrt"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use the actual name of the argument require_full_compilation

add arg require_full_compilation
@apbose apbose force-pushed the require_full_compilation_arg branch from 191f20f to e21852a Compare October 7, 2024 17:24
lanluo-nvidia added a commit that referenced this pull request Oct 8, 2024
@apbose apbose merged commit b99d080 into main Oct 18, 2024
49 of 51 checks passed
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: torch_compile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants