Skip to content

Add memory view data associated with operators#253

Merged
guotuofeng merged 26 commits intoplugin/0.2from
myguo/mem
May 31, 2021
Merged

Add memory view data associated with operators#253
guotuofeng merged 26 commits intoplugin/0.2from
myguo/mem

Conversation

@guotuofeng
Copy link
Contributor

memory view backend

Copy link
Contributor

@gaoteng-git gaoteng-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit test in another PR?
Consider to do side-by-side test comparing with PyTorch profiler's result.

@gaoteng-git
Copy link
Contributor

gaoteng-git commented May 27, 2021

I just come out a new algorithm to optimize traversing speed.

  1. Sort every tree node's children by ts. (If we check PyTorch profiler and make sure the operators are already in time order, this can be omitted).
  2. Sort all memory records by ts.
  3. Traverse the tree only once, by memory records' time order. ("Walk" through the tree by time order leveraging node's ref to its father node, put the current memory record into its direct-father node; Then next memory record could start from this tree node, ...)
  4. Traverse the tree bottom-to-up only once to summarize all columns.

Sorry that I think out late... Let's run the existing one firstly. If perf is not enough, let's optimize it later on.

@guyang3532
Copy link
Contributor

you may need to add an ut to compare with autograd.profiler (refer to test_compare_with_aurograd.py)

"/distributed/waittime": self.comm_wait_route,
"/distributed/commops": self.comm_ops_route
"/distributed/commops": self.comm_ops_route,
"/memory": self.memory_route,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does a ',' at end matter?

@guotuofeng guotuofeng merged commit 9423bb0 into plugin/0.2 May 31, 2021
@guotuofeng guotuofeng deleted the myguo/mem branch May 31, 2021 09:37
@guotuofeng guotuofeng mentioned this pull request May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants