Skip to content
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

[async] Generate DOT graph for StateFlowGraph #1852

Merged
merged 1 commit into from
Sep 7, 2020

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Sep 7, 2020

  • The initial node is drawn as a box
  • The latest state owners are drawn with double edges

Generated DOT graph for misc/visualize_state_flow_graph.py:

digraph {
  n_initial_state_0 [label="[node: initial_state:0]",shape=box]
  n_foo_c4_0_clear_list_0 [label="[node: foo_c4_0_clear_list:0]"]
  n_foo_c4_0_listgen_0 [label="[node: foo_c4_0_listgen:0]"]
  n_foo_c4_0_clear_list_1 [label="[node: foo_c4_0_clear_list:1]"]
  n_foo_c4_0_listgen_1 [label="[node: foo_c4_0_listgen:1]"]
  n_foo_c4_0_struct_for_0 [label="[node: foo_c4_0_struct_for:0]",peripheries=2]
  n_foo_c4_0_clear_list_2 [label="[node: foo_c4_0_clear_list:2]"]
  n_foo_c4_0_listgen_2 [label="[node: foo_c4_0_listgen:2]",peripheries=2]
  n_foo_c4_0_clear_list_3 [label="[node: foo_c4_0_clear_list:3]"]
  n_foo_c4_0_listgen_3 [label="[node: foo_c4_0_listgen:3]",peripheries=2]
  n_bar_c6_0_struct_for_0 [label="[node: bar_c6_0_struct_for:0]",peripheries=2]

  n_initial_state_0 -> n_foo_c4_0_listgen_1 [label="S2dense_mask"]
  n_initial_state_0 -> n_foo_c4_0_listgen_3 [label="S2dense_mask"]
  n_initial_state_0 -> n_foo_c4_0_clear_list_1 [label="S2dense_list"]
  n_initial_state_0 -> n_foo_c4_0_clear_list_0 [label="S1pointer_list"]
  n_initial_state_0 -> n_foo_c4_0_listgen_0 [label="S1pointer_mask"]
  n_initial_state_0 -> n_foo_c4_0_listgen_2 [label="S1pointer_mask"]
  n_initial_state_0 -> n_foo_c4_0_struct_for_0 [label="S3place_i32_value"]
  n_foo_c4_0_struct_for_0 -> n_bar_c6_0_struct_for_0 [label="S4place_i32_value"]
  n_foo_c4_0_listgen_0 -> n_foo_c4_0_clear_list_2 [label="S1pointer_list"]
  n_foo_c4_0_clear_list_2 -> n_foo_c4_0_listgen_2 [label="S1pointer_list"]
  n_foo_c4_0_clear_list_0 -> n_foo_c4_0_listgen_0 [label="S1pointer_list"]
  n_foo_c4_0_clear_list_1 -> n_foo_c4_0_listgen_1 [label="S2dense_list"]
  n_foo_c4_0_listgen_1 -> n_foo_c4_0_struct_for_0 [label="S2dense_list"]
  n_foo_c4_0_listgen_1 -> n_foo_c4_0_clear_list_3 [label="S2dense_list"]
  n_foo_c4_0_clear_list_3 -> n_foo_c4_0_listgen_3 [label="S2dense_list"]
  n_foo_c4_0_listgen_3 -> n_bar_c6_0_struct_for_0 [label="S2dense_list"]
}

Visualization:

a

I also added a launch_id to SFG's node. IMO this allows us to have a slightly more clear view of the nodes, rather than using pointer as the identifier.

Related issue = #742

[Click here for the format server]


@codecov
Copy link

codecov bot commented Sep 7, 2020

Codecov Report

Merging #1852 into master will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1852      +/-   ##
==========================================
- Coverage   44.16%   44.11%   -0.06%     
==========================================
  Files          44       44              
  Lines        6075     6082       +7     
  Branches     1088     1089       +1     
==========================================
  Hits         2683     2683              
- Misses       3223     3230       +7     
  Partials      169      169              
Impacted Files Coverage Δ
python/taichi/misc/util.py 18.18% <0.00%> (-0.76%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32bc391...e4b21b2. Read the comment docs.

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

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

Very cool!! Thank you. The implementation LGTM.

taichi/program/state_flow_graph.h Show resolved Hide resolved
@yuanming-hu yuanming-hu merged commit b8a544d into taichi-dev:master Sep 7, 2020
@k-ye k-ye deleted the dot branch September 8, 2020 10:26
@yuanming-hu yuanming-hu mentioned this pull request Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants