One: Profile multiple subgraphs and sessions

Created on 3 Nov 2020  路  6Comments  路  Source: Samsung/ONE

Currently profile writer for Chrome tracing, md table and snpe does not show a model with multiple subgraphs (executors).
We also need to profile when an app runs multiple sessions at the same time.

Let's ~make ChromeTracing handle~ profile cases with multiple subgraphs and multiple sessions.

Most helpful comment

Now shape info was added.

When is this necessary?

  • if you have a large model where there are lots of ops and you want to find an op whose input shape is [1, 2, 3], you can find it by typing "1 2 3" in _search bar_ now.
  • Another format "[1, 2, 3]" would be better but Chrome browser's Json parser regards "[1, 2, 3]" as a list and it cannot be text-searchable.

image

All 6 comments

Draft: #4903

Sample screen with the following model:

y=neg(0)
while less ( y, 100 )
  y = add (y, 10)
z = cos(y)

You can see 3 subgraphs: primary, while_condition, while_body

  • purple bars: labeled subgraph
  • orange op: neg
  • pink op: cos
  • green op: comparison
  • blue op: add

image

zoom in:
image

I hope we have a subgraph index rather than the object's pointer address, later on. I guess there is no way to get the subgraph index info for now.

Putting the exact subgraph index seems not easy

  • We don't want to put tflite subgraph index into Graph object
  • So we need to have some mapping info class of IR->IR' (e.g., tflite subgraph ->graph pointer)

Maybe what we need is to _distinguish_ subgraphs in human readable way?
For now we could use something like Subgraph A, Subgraph B, etc.

Maybe what we need is to distinguish subgraphs in human readable way?

FYI, Subgraphs in tflite and circle has human readable text name.

Now shape info was added.

When is this necessary?

  • if you have a large model where there are lots of ops and you want to find an op whose input shape is [1, 2, 3], you can find it by typing "1 2 3" in _search bar_ now.
  • Another format "[1, 2, 3]" would be better but Chrome browser's Json parser regards "[1, 2, 3]" as a list and it cannot be text-searchable.

image

All merged.

I'd like to leave how I have tested:

  1. How to check the result (assuming that log name is m.log)

    • check manually m.log, m.log.table.md

    • check manyally m.log.chrome.json

  2. typical case: 1 session, 1 subgraph
  3. generate nnpackage from tests/scripts/models/cache/mobilenet_v1_0.25_128_float_2017_11_08/mobilenet_v1_0.25_128.tflite
$ TRACE_FILEPATH=../mobilenet.log OP_SEQ_MAX_NODE=1  ./Product/out/bin/nnpackage_run --nnpackage ../mobilenet_v1_0.25_128
  1. 1 session, 1 subgraph, OP_SEQ_MAX_NODE=5
$ TRACE_FILEPATH=../mobilenet.log OP_SEQ_MAX_NODE=5  ./Product/out/bin/nnpackage_run --nnpackage ../mobilenet_v1_0.25_128
  • In this case, op name in chrome tracer will have (5) as postfix
  • 1 session, multiple subgraphs
$ TRACE_FILEPATH=../OneOp_While_github_4783.log OP_SEQ_MAX_NODE=1  ./Product/out/unittest_standalone/nnfw_api_gtest --gtest_filter=*.OneOp_While_github_4783
  1. 2 sessions, multiple subgraphs
$ TRACE_FILEPATH=../two_sessions_run_simple_While_model.log OP_SEQ_MAX_NODE=1  ./Product/out/unittest_standalone/nnfw_api_gtest --gtest_filter=ValidationTestTwoSessionsCreated.two_sessions_run_simple_While_model
Was this page helpful?
0 / 5 - 0 ratings

Related issues

binarman picture binarman  路  3Comments

lucenticus picture lucenticus  路  3Comments

mhs4670go picture mhs4670go  路  3Comments

wateret picture wateret  路  4Comments

jinevening picture jinevening  路  3Comments