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

feat: dynamic shapes support for neg ops #2878

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

keehyuna
Copy link
Collaborator

@keehyuna keehyuna commented Jun 3, 2024

Description

Add test case for dynamic shape input of aten.neg ops
Replaced output_dtypes arg in run_test_with_dynamic_shape() with check_dtype to handle
integer type of dynamic shape input test case.

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

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

@github-actions github-actions bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Jun 3, 2024
@github-actions github-actions bot requested a review from gs-olive June 3, 2024 11:06
@keehyuna keehyuna self-assigned this Jun 4, 2024
py/torch_tensorrt/_Input.py Outdated Show resolved Hide resolved
@keehyuna keehyuna marked this pull request as ready for review June 4, 2024 14:51
return torch.rand(self.shape[optimization_profile_field]).to(
dtype=self.dtype.to(torch.dtype, use_default=True)
)
if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can clean this up a bit

if self.dtype in [dtype.u8, dtype.i8, dtype.i32, dtype.i64]:

Copy link
Collaborator

@peri044 peri044 left a comment

Choose a reason for hiding this comment

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

LGTM. I think your PR for where op modifies _Input.py around the example_tensor call. So make sure the bool type change is integrated when you merge.

Copy link
Collaborator

@zewenli98 zewenli98 left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just some minor comments

py/torch_tensorrt/_Input.py Outdated Show resolved Hide resolved
tests/py/dynamo/conversion/harness.py Outdated Show resolved Hide resolved
py/torch_tensorrt/_Input.py Outdated Show resolved Hide resolved
@keehyuna
Copy link
Collaborator Author

Changes for random integer caused failure in arange/cos/sin test. I think it unmasked potential issue as all input values were zero.
I will submit separate PR to address it.

Copy link
Collaborator

@peri044 peri044 left a comment

Choose a reason for hiding this comment

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

LGTM

@peri044 peri044 merged commit bd538b9 into pytorch:main Jun 14, 2024
31 of 37 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: conversion Issues re: Conversion stage 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.

None yet

5 participants