Skip to content

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Apr 19, 2024

Stack from ghstack (oldest at bottom):

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an allow_typevars flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:

  • new tests

Differential Revision: D56432690

cc @ezyang @gchanan

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Apr 19, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/124520

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 515529d with merge base 2f53747 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request Apr 19, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

ghstack-source-id: 04eac8a
Pull Request resolved: #124520
@zou3519 zou3519 added ciflow/trunk Trigger trunk jobs on your pull request keep-going Don't stop on first failure, keep running tests until the end labels Apr 19, 2024
@mikaylagawarecki mikaylagawarecki removed their request for review April 19, 2024 21:16
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request Apr 22, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

ghstack-source-id: 386c2dc
Pull Request resolved: #124520
@zou3519
Copy link
Contributor Author

zou3519 commented Apr 22, 2024

@zou3519 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zou3519 zou3519 added release notes: composability release notes category module: bc-breaking Related to a BC-breaking change and removed release notes: jit release notes category labels Apr 22, 2024
@zou3519
Copy link
Contributor Author

zou3519 commented Apr 22, 2024

This is technically BC-breaking. If you want the old behavior, use torch::schema(<schema_str>, allow_typevars=True) when defining an operator.

Copy link
Member

@williamwen42 williamwen42 left a comment

Choose a reason for hiding this comment

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

lgtm - will defer due to BC breaking change.

Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

This doesn't change TORCH_LIBRARY so I'm good :)

@zou3519
Copy link
Contributor Author

zou3519 commented Apr 23, 2024

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

@zou3519 your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Apr 26, 2024
This reverts commit 1418887.

Reverted #124520 on behalf of https://github.com/jeanschmidt due to Breaking internal tests check D56588015 for more details ([comment](#124520 (comment)))
alat-rights pushed a commit to alat-rights/pytorch that referenced this pull request Apr 26, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

Differential Revision: [D56432690](https://our.internmc.facebook.com/intern/diff/D56432690)

Pull Request resolved: pytorch#124520
Approved by: https://github.com/albanD
pytorch-bot bot pushed a commit that referenced this pull request May 3, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

Differential Revision: [D56432690](https://our.internmc.facebook.com/intern/diff/D56432690)

Pull Request resolved: #124520
Approved by: https://github.com/albanD
pytorch-bot bot pushed a commit that referenced this pull request May 3, 2024
This reverts commit 5b98d43.

Reverted #124520 on behalf of https://github.com/zou3519 due to broke static runtime tests ([comment](#124520 (comment)))
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

Differential Revision: [D56432690](https://our.internmc.facebook.com/intern/diff/D56432690)

Pull Request resolved: pytorch#124520
Approved by: https://github.com/albanD
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
This reverts commit 1418887.

Reverted pytorch#124520 on behalf of https://github.com/jeanschmidt due to Breaking internal tests check D56588015 for more details ([comment](pytorch#124520 (comment)))
@malfet malfet added topic: bc breaking topic category and removed topic: bc_breaking labels May 20, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

Differential Revision: [D56432690](https://our.internmc.facebook.com/intern/diff/D56432690)

cc ezyang gchanan

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request May 21, 2024
Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan:
- new tests

Differential Revision: [D56432690](https://our.internmc.facebook.com/intern/diff/D56432690)

Pull Request resolved: #124520
Approved by: https://github.com/albanD
ghstack-source-id: 1232820
zou3519 added a commit to zou3519/executorch that referenced this pull request May 22, 2024
Summary:
co-dev reland of pytorch/pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Differential Revision: D57666659
zou3519 added a commit to zou3519/pytorch that referenced this pull request May 22, 2024
Summary:

X-link: pytorch/executorch#3705

co-dev reland of pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan: Wait for tests

Differential Revision: D57666659
zou3519 added a commit to zou3519/executorch that referenced this pull request May 22, 2024
Summary:
X-link: pytorch/pytorch#126861


co-dev reland of pytorch/pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Differential Revision: D57666659
zou3519 added a commit to zou3519/executorch that referenced this pull request May 22, 2024
Summary:
X-link: pytorch/pytorch#126861


co-dev reland of pytorch/pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Reviewed By: albanD

Differential Revision: D57666659
zou3519 added a commit to zou3519/pytorch that referenced this pull request May 22, 2024
Summary:

X-link: pytorch/executorch#3705

co-dev reland of pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan: Wait for tests

Reviewed By: albanD

Differential Revision: D57666659
facebook-github-bot pushed a commit to pytorch/executorch that referenced this pull request May 23, 2024
Summary:
X-link: pytorch/pytorch#126861

Pull Request resolved: #3705

co-dev reland of pytorch/pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Reviewed By: albanD

Differential Revision: D57666659

fbshipit-source-id: 25b0c247229ea78966725a3678dd01fdcc02c91d
pytorchmergebot pushed a commit that referenced this pull request May 23, 2024
Summary:
co-dev reland of #124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan: Wait for tests

Differential Revision: D57666659

Pull Request resolved: #126861
Approved by: https://github.com/albanD
@zou3519
Copy link
Contributor Author

zou3519 commented May 24, 2024

landed in #126861

@zou3519 zou3519 closed this May 24, 2024
kirklandsign pushed a commit to kirklandsign/executorch that referenced this pull request May 24, 2024
Summary:
X-link: pytorch/pytorch#126861

Pull Request resolved: pytorch#3705

co-dev reland of pytorch/pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Reviewed By: albanD

Differential Revision: D57666659

fbshipit-source-id: 25b0c247229ea78966725a3678dd01fdcc02c91d
titaiwangms pushed a commit to titaiwangms/pytorch that referenced this pull request May 28, 2024
Summary:
co-dev reland of pytorch#124520, which requires
the removal of some executorch tests.

Before this PR, we didn't check that types in a schema were valid. This
is because TorchScript treats unknown types as type variables.

This PR checks types in a schema for the TORCH_LIBRARY APIs. To do this,
we add an `allow_typevars` flag to parseSchema so that TorchScript can
use allow_typevars=True. We also add some error messages for common
mistakes (e.g. using int64_t or double in schema).

Test Plan: Wait for tests

Differential Revision: D57666659

Pull Request resolved: pytorch#126861
Approved by: https://github.com/albanD
@github-actions github-actions bot deleted the gh/zou3519/979/head branch June 23, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-td-distributed ciflow/trunk Trigger trunk jobs on your pull request keep-going Don't stop on first failure, keep running tests until the end Merged module: bc-breaking Related to a BC-breaking change release notes: composability release notes category Reverted topic: bc breaking topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants