Skip to content

Make ExpectCounterChanged to account for _symint ops without fixing the tests or ops explicitly#3978

Merged
ezyang merged 6 commits intomasterfrom
krovatkinnew-symint-iface
Sep 9, 2022
Merged

Make ExpectCounterChanged to account for _symint ops without fixing the tests or ops explicitly#3978
ezyang merged 6 commits intomasterfrom
krovatkinnew-symint-iface

Conversation

@Krovatkin
Copy link
Copy Markdown
Contributor

@Krovatkin Krovatkin commented Sep 7, 2022

Make ExpectCounterChanged to account for _symint ops without fiMake ExpectCounterChanged to account for _symint ops without fixing the tests or ops explicitlyxing the tests or ops explicitly.

we are hitting test failures w/ counters after we symintified a few kernel and added the "_symint" suffix. Unfortunately, the failures are bit cryptic and requires some investigation: https://github.com/pytorch/pytorch/runs/8231927032?check_suite_focus=true . These failures would happen every time we rename an op.
This PR tweaks ExpectCounterChanged to account for possible renames of ops to _symint.

ezyang and others added 3 commits September 7, 2022 10:57
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
@Krovatkin
Copy link
Copy Markdown
Contributor Author

@JackCaoG lets see if this'd do it

@Krovatkin Krovatkin force-pushed the krovatkinnew-symint-iface branch from ce170d1 to 86f003e Compare September 7, 2022 22:00
@Krovatkin Krovatkin force-pushed the krovatkinnew-symint-iface branch from 86f003e to e43f4d3 Compare September 7, 2022 22:56
@Krovatkin Krovatkin requested review from JackCaoG and ezyang September 8, 2022 04:33
@ezyang
Copy link
Copy Markdown
Collaborator

ezyang commented Sep 8, 2022

Looks like it worked. So I can land this companion diff instead of mine when we finally land.

@Krovatkin Krovatkin force-pushed the krovatkinnew-symint-iface branch 2 times, most recently from 07595d3 to e43f4d3 Compare September 8, 2022 17:08
@Krovatkin Krovatkin requested a review from wonjoo-wj September 8, 2022 17:12
Copy link
Copy Markdown
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

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

Thanks Nick!

@ezyang ezyang merged commit 1e71c8e into master Sep 9, 2022
@miladm miladm added the dynamism Dynamic Shape Features label Sep 25, 2022
// `opName_symint` counters. When we finish migrating the ops to symints, we
// would remove this logic and fix all the tests
auto changed_symint =
start_msnap_->CounterChanged(counter_regex, *end_msnap_, ignore_set);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this line not saying counter_regex + "_symint"? I am trying to understand the diff between line 54 and 63 here.

CC @JackCaoG @Krovatkin

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

seems likes a typo we should fix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I will push a PR shortly.


at::Tensor XLANativeFunctions::view(const at::Tensor& self,
at::SymIntArrayRef sym_size) {
at::Tensor XLANativeFunctions::view_symint(const at::Tensor& self,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To catch up:

  • I understand this PR only enables SymInt for view
  • I don't expect view is ready for Dynamic Shape through this change - i.e. more work would be needed for DS enablement. The same applies to empty, narrow_copy.

@Krovatkin @JackCaoG please confirm (or correct me if inaccurate).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, all this does is change the calling convention; but the insides still assert that the int is not symbolic. Once the IR side is ready, you can just modify this function to track it.

Future SymInt'ified schemas will not get updates like this, because we subsequently added an interlock (the symint: field in the yaml) which controls which calling convention you get. But there's a few stragglers like this from before we had this interlock.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Once the IR side is ready, you can just modify this function to track it.

Is this part of an existing PR already? If so, please point me to it so I follow your changes accordingly.

@ezyang

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no, that was up to you guys :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dynamism Dynamic Shape Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants