commit | 456909e5d350810e941290ee61c1dfc3315a9a69 | [log] [tgz] |
---|---|---|
author | Aaron Enye Shi <enye.shi@gmail.com> | Sun Aug 11 23:27:47 2024 +0000 |
committer | PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> | Sun Aug 11 23:27:48 2024 +0000 |
tree | f1dd27d85308c33654eecb662a7b0f61669a4f5a | |
parent | 2d71f03db124bd1517627d34896dd2d9248227af [diff] |
[Memory Snapshot][Viz] Show event timestamps if collected (#132523) Summary: Since we've been capturing timestamps for awhile (since https://github.com/pytorch/pytorch/pull/112266), we can surface this into the UI. This can be useful to correlate with timing of other events. Test Plan: Ran it locally.  Differential Revision: D60673800 Pulled By: aaronenyeshi Pull Request resolved: https://github.com/pytorch/pytorch/pull/132523 Approved by: https://github.com/tianfengfrank, https://github.com/zdevito
diff --git a/torch/utils/viz/MemoryViz.js b/torch/utils/viz/MemoryViz.js index e725ae1..7b49236 100644 --- a/torch/utils/viz/MemoryViz.js +++ b/torch/utils/viz/MemoryViz.js
@@ -983,6 +983,10 @@ if (elem.stream !== null) { text = `${text}, stream ${elem.stream}`; } + if (elem.timestamp !== null) { + var d = new Date(elem.time_us / 1000); + text = `${text}, timestamp ${d}`; + } if (!elem.action.includes('alloc')) { text = `${text}\nalloc not recorded, stack trace for free:`; }