1
$\begingroup$

I’m working on a project that heavily relies on computation graph manipulations but isn’t directly in the field of machine learning. However, we are using PyTorch due to its flexibility and support for dynamic computation graphs.

Our challenge lies in visualizing a model that doesn’t have traditional input parameters, as its functionality is not tied to optimizing weights in the usual ML sense. The forward pass involves operations over internal state variables, and we want to debug the graph to ensure all operations remain connected and gradients propagate correctly.

Most visualization tools I’ve come across (like torchviz) require a forward method with an input parameter to trace the graph. Is there a way to visualize or debug the computation graph of such a model where the operations are driven entirely by internal states?

Any pointers, best practices, or alternative tools to explore would be greatly appreciated. Thanks!

$\endgroup$

1 Answer 1

0
$\begingroup$

Hey ik its a bit late but I've created a tool that might possibly help: I finished building a PyTorch Graph Tracer to make debugging easier! This tool visualizes the order in which tensors are created, making it simple to understand the flow and structure of the tensors involved (not necessarily needing forward method)It’s a solid first version, but more operations can be added!

Feel free to test it out, share feedback or suggestions for improvement, and let me know if you find any bugs!

The code is in this link: 2manikan/Pytorch_DAG_Visualization_Tool

Note: For now, it works by installing PyTorch, cloning the repo, and keeping all the files in the same folder. The README has more details!

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.