Skip to content

Conversation

@aorenste
Copy link
Contributor

@aorenste aorenste commented Jun 2, 2025

Summary:
X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that __getattr__ can return a single type in all other cases.

Decisions made along the way:

  1. torch.ops.higher_order is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the _Ops class.
  2. __getattr__ is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Differential Revision: D75497142

Co-authored-by: Benjamin Glass [email protected]

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 2, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 361ffdf with merge base 63b047b (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 2, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

@aorenste aorenste added the release notes: none Do not include this in the release notes label Jun 2, 2025
aorenste added a commit to aorenste/pytorch that referenced this pull request Jun 2, 2025
Summary:
X-link: pytorch/executorch#11276


Cloned pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Test Plan: CI

Differential Revision: D75497142
@aorenste aorenste force-pushed the export-D75497142 branch from 0d62b68 to 891904a Compare June 3, 2025 16:45
aorenste added a commit to aorenste/executorch that referenced this pull request Jun 3, 2025
Summary:

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93

Differential Revision: D75497142
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

aorenste added a commit to aorenste/executorch that referenced this pull request Jun 3, 2025
Summary:
Pull Request resolved: pytorch#11276

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93

Differential Revision: D75497142
@aorenste aorenste force-pushed the export-D75497142 branch from 891904a to 7bf216c Compare June 3, 2025 16:48
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

aorenste added a commit to aorenste/executorch that referenced this pull request Jun 12, 2025
Summary:
Pull Request resolved: pytorch#11276

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
pytorch-bot bot pushed a commit to pytorch/pytorch that referenced this pull request Jun 12, 2025
Summary:
X-link: pytorch/executorch#11276

Pull Request resolved: #154555

Cloned #153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Test Plan: CI

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

aorenste added a commit to aorenste/executorch that referenced this pull request Jun 13, 2025
Summary:
Pull Request resolved: pytorch#11276

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

aorenste added a commit to aorenste/executorch that referenced this pull request Jun 13, 2025
Summary:
Pull Request resolved: pytorch#11276

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
aorenste added a commit to aorenste/pytorch that referenced this pull request Jun 13, 2025
Summary:
X-link: pytorch/executorch#11276

Pull Request resolved: pytorch#154555

Cloned pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Test Plan: CI

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
aorenste added a commit to aorenste/executorch that referenced this pull request Jun 20, 2025
Summary:

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

aorenste added a commit to aorenste/executorch that referenced this pull request Jun 20, 2025
Summary:
Pull Request resolved: pytorch#11276

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
aorenste added a commit to aorenste/pytorch that referenced this pull request Jun 21, 2025
Summary:
X-link: pytorch/executorch#11276


Cloned pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Test Plan: CI

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
aorenste added a commit to aorenste/executorch that referenced this pull request Jun 21, 2025
Summary:

X-link: pytorch/pytorch#154555

Cloned pytorch/pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

aorenste added a commit to aorenste/pytorch that referenced this pull request Jun 21, 2025
Summary:
X-link: pytorch/executorch#11276


Cloned pytorch#153558 from benjaminglass1 and fixed internal typing errors.

Fixes longstanding issue where direct references to aten operations are seen as untyped by type checkers. This is accomplished by setting attributes on several classes more consistently, so that `__getattr__` can return a single type in all other cases.

Decisions made along the way:

1. `torch.ops.higher_order` is now implemented by a single-purpose class. This was effectively true before, but the class implementing it attempted to be generalized unnecessarily. Fixing this simplified typing for the `_Ops` class.
2. `__getattr__` is only called when all other lookup methods have failed, so several constant special-cases in the function could be implemented as class variables.

The remainder of this PR is fixing up all the bugs exposed by the updated typing, as well as all the nitpicky typing issues.

Test Plan: CI

Reviewed By: bobrenjc93, mergennachin

Differential Revision: D75497142
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75497142

@aorenste aorenste closed this Jun 21, 2025
@huydhn huydhn temporarily deployed to upload-benchmark-results June 21, 2025 16:39 — with GitHub Actions Inactive
@facebook-github-bot facebook-github-bot temporarily deployed to upload-benchmark-results June 21, 2025 17:02 — with GitHub Actions Inactive
@huydhn huydhn temporarily deployed to upload-benchmark-results June 21, 2025 17:36 — with GitHub Actions Inactive
@huydhn huydhn temporarily deployed to upload-benchmark-results June 21, 2025 20:38 — with GitHub Actions Inactive
@huydhn huydhn temporarily deployed to upload-benchmark-results June 21, 2025 21:36 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants