Make trivial thread-idx for degenerate statements without thread-idx.#36480
Make trivial thread-idx for degenerate statements without thread-idx.#36480zheng-xq wants to merge 5 commits intogh/zheng-xq/3/basefrom
Conversation
[ghstack-poisoned]
💊 Build failures summary and remediationsAs of commit 77dee3f (more details on the Dr. CI page):
XLA failureJob pytorch_xla_linux_bionic_py3_6_clang9_build is failing. Please create an issue with title prefixed by This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 15 times. |
…thread-idx." Differential Revision: [D20992505](https://our.internmc.facebook.com/intern/diff/D20992505) [ghstack-poisoned]
…thread-idx." Differential Revision: [D20992505](https://our.internmc.facebook.com/intern/diff/D20992505) [ghstack-poisoned]
ZolotukhinM
left a comment
There was a problem hiding this comment.
Looks good overall, some comments are inline!
| } | ||
|
|
||
| // Find all the statements that are not covered by any thread-idx axes, | ||
| // and wrapp them under a trivial thread idx. |
| std::list<Stmt*> old_stmts = v->stmts(); | ||
| std::vector<bool> need_rewrites(old_stmts.size()); | ||
| std::vector<Stmt*> new_stmts(old_stmts.size()); | ||
| ; |
|
|
||
| start = stop; | ||
| } | ||
| Stmt* rewritten_block = Block::make(rewrite_stmts); |
There was a problem hiding this comment.
Maybe add an assert that rewrite_stmts.size() == new_stmts.size() == old_stmts.size()?
| b_ref(i) = i; | ||
| } | ||
|
|
||
| float* a_dev = nullptr; |
There was a problem hiding this comment.
Running the codegen is not sufficient here, I think. Can you verify the correct code was generated in a literal way?
There was a problem hiding this comment.
Added a TODO to add the check in a follow-up.
…thread-idx." Differential Revision: [D20992505](https://our.internmc.facebook.com/intern/diff/D20992505) [ghstack-poisoned]
…thread-idx." Differential Revision: [D20992505](https://our.internmc.facebook.com/intern/diff/D20992505) [ghstack-poisoned]
…pytorch#36480) Summary: Pull Request resolved: pytorch#36480 Test Plan: Imported from OSS Differential Revision: D20992505 Pulled By: zheng-xq fbshipit-source-id: 3d4e5401b59b9507b5f2db659e511bd1af53f5ab
Stack from ghstack:
Differential Revision: D20992505