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

typing scheduler.py [2/2]: Apply types #126656

Closed
wants to merge 6 commits into from

Conversation

aorenste
Copy link
Contributor

@aorenste aorenste commented May 19, 2024

Add # mypy: disallow-untyped-defs to scheduler.py and then fix the resulting fallout.

We probably should eventually add a new node between BaseSchedulerNode and all the non-FusedSchedulerNode types to indicate the split between nodes that have a valid self.node and ones that don't. That would cause a lot of the assert self.node is not None churn to go away - but was a bigger change because a lot of code makes assumptions about types that aren't reflected in the types themselves.

Stack from ghstack (oldest at bottom):

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang

[ghstack-poisoned]
Copy link

pytorch-bot bot commented May 19, 2024

🔗 Helpful Links

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

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

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (2 Unrelated Failures)

As of commit ee738ba with merge base b40fb2d (image):

UNSTABLE - The following jobs failed but were likely due to flakiness present on trunk and has been marked as unstable:

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

aorenste added a commit that referenced this pull request May 19, 2024
ghstack-source-id: 702b23008da8a43908264dac95bb304970f75dfa
Pull Request resolved: #126656
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
aorenste added a commit that referenced this pull request May 20, 2024
ghstack-source-id: 6596532ae6347becffe4d254bc8dd4e20ef1ed02
Pull Request resolved: #126656
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
aorenste added a commit that referenced this pull request May 20, 2024
ghstack-source-id: fa31920533cdf7319182e5ef9919054d34d9e545
Pull Request resolved: #126656
@aorenste aorenste changed the title Fix typing, attempt 2 typing scheduler.py [2/2]: Apply types May 20, 2024
@aorenste aorenste requested a review from eellison May 20, 2024 17:48
@aorenste aorenste marked this pull request as ready for review May 20, 2024 17:49
@aorenste aorenste added the topic: not user facing topic category label May 20, 2024
Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

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

nice, looks good! could you rebase onto more stable master to land ?

torch/_inductor/codegen/triton_foreach.py Outdated Show resolved Hide resolved
Add `# mypy: disallow-untyped-defs` to scheduler.py and then fix the resulting fallout.

We probably should eventually add a new node between BaseSchedulerNode and all the non-FusedSchedulerNode types to indicate the split between nodes that have a valid `self.node` and ones that don't. That would cause a lot of the `assert self.node is not None` churn to go away - but was a bigger change because a lot of code makes assumptions about types that aren't reflected in the types themselves.




cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
aorenste added a commit that referenced this pull request May 21, 2024
ghstack-source-id: fcd833d9bf666e5f1c63edfd890087a4339973d1
Pull Request resolved: #126656
Add `# mypy: disallow-untyped-defs` to scheduler.py and then fix the resulting fallout.

We probably should eventually add a new node between BaseSchedulerNode and all the non-FusedSchedulerNode types to indicate the split between nodes that have a valid `self.node` and ones that don't. That would cause a lot of the `assert self.node is not None` churn to go away - but was a bigger change because a lot of code makes assumptions about types that aren't reflected in the types themselves.




cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
aorenste added a commit that referenced this pull request May 21, 2024
ghstack-source-id: 471fe132f4a697469b5723f95ae53cc474bd584f
Pull Request resolved: #126656
Add `# mypy: disallow-untyped-defs` to scheduler.py and then fix the resulting fallout.

We probably should eventually add a new node between BaseSchedulerNode and all the non-FusedSchedulerNode types to indicate the split between nodes that have a valid `self.node` and ones that don't. That would cause a lot of the `assert self.node is not None` churn to go away - but was a bigger change because a lot of code makes assumptions about types that aren't reflected in the types themselves.




cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
aorenste added a commit that referenced this pull request May 21, 2024
ghstack-source-id: a551e876c61c7209cbf15bc6141a1a89d2490cb8
Pull Request resolved: #126656
@aorenste
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 22, 2024
@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

Merge failed

Reason: Not merging any PRs at the moment because there is a merge blocking https://github.com/pytorch/pytorch/labels/ci:%20sev issue open at:
#126896

Details for Dev Infra team Raised by workflow job

@aorenste
Copy link
Contributor Author

@pytorchbot merge

1 similar comment
@aorenste
Copy link
Contributor Author

@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

snodes = (node,) if isinstance(node, SchedulerNode) else node.snodes
device = snodes[0].get_device()
backend = node.scheduler.get_backend(device)
assert isinstance(backend, TritonScheduling)
Copy link
Contributor

Choose a reason for hiding this comment

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

This assert fails. Not sure why CI does not catch it.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, maybe CI caches it, but this is caught and skipped

Copy link
Contributor

Choose a reason for hiding this comment

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

I ran into this as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in #127021

aorenste added a commit that referenced this pull request May 24, 2024
[ghstack-poisoned]
@aorenste aorenste mentioned this pull request May 24, 2024
aorenste added a commit that referenced this pull request May 24, 2024
ghstack-source-id: eed2209d050847b8360af87f7569587208bac6c7
Pull Request resolved: #127050
pytorchmergebot pushed a commit that referenced this pull request May 24, 2024
Fix failure from fbcode - in the case of a foreach node the fake `group` needs to be hashable.

Pull Request resolved: #127050
Approved by: https://github.com/DanilBaibak
ghstack dependencies: #126656
titaiwangms pushed a commit to titaiwangms/pytorch that referenced this pull request May 28, 2024
Fix failure from fbcode - in the case of a foreach node the fake `group` needs to be hashable.

Pull Request resolved: pytorch#127050
Approved by: https://github.com/DanilBaibak
ghstack dependencies: pytorch#126656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants