Computation Graph
Understanding how Trace2 builds and uses computation graphs
Computation Graph
Trace2 automatically builds a computation graph of your AI system's execution, similar to how PyTorch builds graphs for neural networks.
What is a Computation Graph?
How Trace2 Builds Graphs
[Add explanation]
Visualizing Graphs
Trace2 provides built-in visualization:
z.backward("maximize z", visualize=True, print_limit=25)Graph Propagation
Comparison to AutoDiff
| Feature | AutoDiff (PyTorch) | Trace2 |
|---|---|---|
| Input | Tensors | Any Python objects |
| Operations | Math operations | Any function calls |
| Gradient | Numerical | Natural language feedback |
| Output | Updated weights | Updated code/prompts |