Skip to content

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
@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

@keehyuna keehyuna force-pushed the neg_dynamic_shape branch from 436e99b to 6d7f2fb Compare June 13, 2024 15:01
@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
@keehyuna keehyuna deleted the neg_dynamic_shape branch August 19, 2024 03:52
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.

5 participants