aitemplate.utils

visualization.plot

Graph visualization tool for AITemplate

Functions:

plot_graph(tensors, file_path[, ...])

Plot AIT graph.

short_str(s[, length])

Returns a hashed string, somewhat similar to URL shortener.

shorten_tensor_names_for_plots()

When enabled, long tensor names will be replaced with a hash string, making the graph representation significantly simpler.

aitemplate.utils.visualization.plot.plot_graph(tensors, file_path: str, file_with_time_profiles: Optional[str] = None) None[source]

Plot AIT graph.

Parameters:
  • tensors (Union[Tensor, List[Tensor]]) – An output Tensor, or a list of output Tensors of AIT graph.

  • file_path (str) –

    Output file path, currently we support the following extension:
    • html

    • format supported by graphviz

  • file_with_time_profile (Optional[str]) – Adds time for every node, if provided

aitemplate.utils.visualization.plot.short_str(s, length=8) str[source]

Returns a hashed string, somewhat similar to URL shortener.

aitemplate.utils.visualization.plot.shorten_tensor_names_for_plots() bool[source]

When enabled, long tensor names will be replaced with a hash string, making the graph representation significantly simpler.