-
Notifications
You must be signed in to change notification settings - Fork 24.5k
[Profiler] Make KinetoEvent a view of Result (Part 2, python and stacks) #81320
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
Conversation
The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
🔗 Helpful links
❌ 1 New FailuresAs of commit 76c5d5a (more details on the Dr. CI page): Expand to see more
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
} | ||
|
||
const c10::ArrayRef<std::string> KinetoEvent::stack() const { | ||
auto get = [&](const auto& i) { |
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.
C++: Just use lambdas, they simplify everything.
Also C++: "This line is missing -> auto&
so we made a copy and now ASAN is mad."
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
Pull Request resolved: #81320 The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. ghstack-source-id: 162969387 Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/)
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
Pull Request resolved: #81320 The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. ghstack-source-id: 163104855 Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/)
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…ks) (#81320) The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) Pull Request resolved: #81320 Approved by: https://github.com/pbelevich
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and 8000 just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
Pull Request resolved: #81320 The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. ghstack-source-id: 163748936 Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/)
…on and stacks)" The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Differential Revision: [D37481561](https://our.internmc.facebook.com/intern/diff/D37481561/) [ghstack-poisoned]
…ks) (#81320) (#81320) Summary: The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types. By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in `EventFieldsVisitor` and just lean on `KinetoEvent.stack()`. Pull Request resolved: #81320 Approved by: https://github.com/pbelevich Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/7a726a4f2dcdaadc5d2863197cf0bbca569a564f Original Phabricator Test Plan: Existing unit tests Reviewed By: chaekit, seemethere, kit1980 Differential Revision: D37481561 Pulled By: robieta fbshipit-source-id: 1ac7bd183c076b1c59646571d89a90d25efae8ff
Stack from ghstack (oldest at bottom):
result_
) #81321The semantics of python in KinetoEvent are sort of crazy because values can come either from metadata captured by JIT or from the python tracer. Things aren't helped by the fact that we encode the python hierarchy in the chrome trace for tensorboard, so we have to do a tree traversal with skips based on types.
By simply constructing the Python stack in KinetoEvent's ctor we're able to skip a lot of the complexity in
EventFieldsVisitor
and just lean onKinetoEvent.stack()
.Differential Revision: D37481561