Skip to content

Conversation

ZolotukhinM
Copy link

@ZolotukhinM ZolotukhinM commented Apr 17, 2020

Stack from ghstack:

Differential Revision: D21099913

@ZolotukhinM ZolotukhinM requested a review from apaszke as a code owner April 17, 2020 22:20
ZolotukhinM pushed a commit that referenced this pull request Apr 17, 2020
… valid scope.

ghstack-source-id: 1cbc902
Pull Request resolved: #36836
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Apr 17, 2020
@dr-ci
Copy link

dr-ci bot commented Apr 17, 2020

💊 Build failures summary and remediations

As of commit ae67e49 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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.

See how this bot performed.

This comment has been revised 3 times.

@ZolotukhinM ZolotukhinM requested a review from zheng-xq April 17, 2020 23:36
class ContainedStmtsFinder : public IRVisitor {
public:
// Simply list all Stores and LetStmts that are children of the given stmt
std::unordered_set<Stmt*> findContainedStmts(Stmt* s) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return a const ref?


private:
void visit(const Store* v) override {
if (stores_[v->buf()].insert(last_stmt_).second) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit picking: it is a bit weird that the condition evaluation has an important side-effect. it might be better to separate ".insert" into its own statement.

Copy link
Author

Choose a reason for hiding this comment

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

It's actually an idiom I've seen and used a lot previously.


TORCH_API Stmt* FlattenIndexes(Stmt* s);

struct BufUse {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: a class here somewhat implies that users might want to know this. But actually this class structure is very much internal to our development. It might be better to move to a internal header file, or implementation files.

Copy link
Author

Choose a reason for hiding this comment

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

I would defer this until we decide on how our dep-analysis should look like. I added the corresponding TODO comment.

return nullptr;
}

Block* findLowestContainingBlock(const std::vector<BufUse>& uses) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: add a TODO to see if we should improve the performance of this block for larger programs. Many systems I knew look at all the parents in reverse order, and find the lowest one.

…e innermost valid scope."

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

[ghstack-poisoned]
ZolotukhinM pushed a commit that referenced this pull request Apr 22, 2020
… valid scope.

ghstack-source-id: 97d920e
Pull Request resolved: #36836
@facebook-github-bot
Copy link
Contributor

@ZolotukhinM merged this pull request in b8e2d79.

@facebook-github-bot facebook-github-bot deleted the gh/ZolotukhinM/230/head branch April 25, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants