Improve autograd profiler performance#11773
Conversation
d2eaf15 to
6c2a36b
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot retest this please |
torch/csrc/autograd/profiler.cpp
Outdated
|
|
||
| void pushRange(std::string name, const char* msg/*= ""*/, int64_t sequence_nr/*= -1*/) { | ||
| const char* c_str(const char *str) { return str; } | ||
| const char* c_str(const std::string& str) { return str.c_str(); } |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| std::string name_; | ||
| uint32_t thread_id_; | ||
| int64_t cpu_ns_; // signed to allow for negative intervals | ||
| std::unique_ptr<std::string> owned_name_; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
facebook-github-bot
left a comment
There was a problem hiding this comment.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
To illustrate the benefits of this commit, I'll use the time/iter I got from one of the JIT benchmarks on my machine.
clock_gettimeinstead ofstd::chronoconst char*instead ofstd::string