-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Liveness for BailOut graphs #21615
Liveness for BailOut graphs #21615
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, minor comments.
} | ||
|
||
std::shared_ptr<Graph> graph_; | ||
std::map<Node*, SparseBitVector> liveness_sets_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why map?
|
||
using ::c10::ProfiledTensorTypePtr; | ||
using SparseBitVector = ::c10::SparseBitVector<256>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment descibing the form of the output? Is that live in or live out of a node?
torch/csrc/jit/passes/liveness.cpp
Outdated
liveness |= block_outputs; | ||
|
||
SparseBitVector defs; | ||
for (auto it = b->nodes().rbegin(); it != b->nodes().rend(); it++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (Node* n : b->nodes().reverse())
torch/csrc/jit/passes/liveness.cpp
Outdated
} | ||
|
||
liveness |= toSparseBitVector(it->inputs()); | ||
liveness -= toSparseBitVector(it->outputs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to go at the beginning of the loop right? Otherwise the outputs of an if statement will appear live in the body of the if statement. This line is also repeated twice for a loop which seems wrong.
torch/csrc/jit/passes/liveness.cpp
Outdated
: graph_(std::move(graph)) {} | ||
|
||
std::map<Node*, std::vector<Value*>> run() { | ||
auto function_outputs = toSparseBitVector(graph_->block()->outputs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant, right? the first thing visiting a block does is union the outputs into the liveness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Krovatkin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@Krovatkin merged this pull request in 8dd6706. |
Pretty sure this broke master:
|
@jamesr66a i'll disable the tests, i didn't expect them to be so unstable 😢 |
No description provided.