profile ivalue for nvfuser#47668
Conversation
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit afbff83 (more details on the Dr. CI page):
🕵️ 7 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
[ghstack-poisoned]
[ghstack-poisoned]
|
@jjsjann123 can you get someone from nvidia to review and accept before we land this ? @Krovatkin |
| void profileIntList(ProfilingRecord* pr, Node* node, size_t offset) { | ||
| auto pn = insertProfileIValueOp(node, offset, pr); | ||
|
|
||
| std::function<void(Stack&)> ivalue_profiler = [pr, pn](Stack& stack) { |
There was a problem hiding this comment.
why assign to a std::function here? (rather than say ... const auto)
| void profileBool(ProfilingRecord* pr, Node* node, size_t offset) { | ||
| auto pn = insertProfileIValueOp(node, offset, pr); | ||
|
|
||
| std::function<void(Stack&)> ivalue_profiler = [pr, pn](Stack& stack) { |
| return IrParser::canParseNode(node); | ||
| } | ||
|
|
||
| // TODO: we should incorporate this to our parser as well; |
There was a problem hiding this comment.
It's not clear what our parser refers to in this context: replace our parser to a more explicit pointer ?
| ->schema(); | ||
| if (node->matches(reduction_operator_schema)) { | ||
| switch (offset) { | ||
| case 1: |
| } | ||
|
|
||
| void insertProfileNodesForCUDAFuser_(Block* block, ProfilingRecord* pr) { | ||
| for (auto it = block->nodes().begin(); it != block->nodes().end(); ++it) { |
There was a problem hiding this comment.
for (const auto& n : block->nodes()) ?
|
|
||
| // TODO: failure in buildShapeExpressions should not break fusion execution, | ||
| // we can add a try/catch here to bailout from removeOutputsUsedOnlyInSize. | ||
| GRAPH_DUMP("before build shape expression: ", graph_); |
There was a problem hiding this comment.
does this unconditionally dump the graph?
There was a problem hiding this comment.
Nope, this is only enabled via environment variable:
pytorch/torch/csrc/jit/jit_log.h
Lines 6 to 37 in cbc34db
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
…or nvfuser. We tried to go around PR pytorch#47667 refactor profiling optional, since upstream is still working on it at this time.
* This is a cherry-pick from upstream PR pytorch#47668 profile ivalue for nvfuser. We tried to go around PR pytorch#47667 refactor profiling optional, since upstream is still working on it at this time. createConditionalConstant supports profile ivalue including bool, int_list and size New guard to check conditional constant at runtime size_eq_guard op to facilitate comparison of dynamic sizes sum_to_size & _grad_sum_to_size added in integration
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Differential Revision: [D25255571](https://our.internmc.facebook.com/intern/diff/D25255571) [ghstack-poisoned]
Stack from ghstack:
Differential Revision: D25255571