mlcommons / chakra

Repository for MLCommons Chakra schema and tools
https://mlcommons.org/working-groups/research/chakra/
Apache License 2.0
45 stars 17 forks source link

Add docstrings and enhance help messages in visualizer #93

Closed TaekyungHeo closed 3 weeks ago

TaekyungHeo commented 3 weeks ago

Summary

Add docstrings and enhance help messages in visualizer

Test Plan

$ chakra_visualizer --help
usage: chakra_visualizer [-h] --input_filename INPUT_FILENAME --output_filename OUTPUT_FILENAME

Execution Trace Visualizer

options:
  -h, --help            show this help message and exit
  --input_filename INPUT_FILENAME
                        Input Chakra execution trace filename
  --output_filename OUTPUT_FILENAME
                        Output graph filename. Supported extensions are pdf, dot, and graphml. Recommend
                        using graphml for large graphs for rendering speed.
$ chakra_visualizer --input_filename megatron_0.chakra --output_filename megatron_0.graphml 
$ head megatron_0.graphml 
<?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d1" for="edge" attr.name="dependency" attr.type="string" />
  <key id="d0" for="node" attr.name="label" attr.type="string" />
  <graph edgedefault="directed">
    <node id="1">
      <data key="d0">[pytorch|profiler|execution_trace|thread]</data>
    </node>
    <node id="0" />
    <node id="2">
github-actions[bot] commented 3 weeks ago

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅