{"id":39663176,"url":"https://github.com/zombie-einstein/jaxpr-viz","last_synced_at":"2026-01-18T09:25:56.033Z","repository":{"id":189721196,"uuid":"680576467","full_name":"zombie-einstein/jaxpr-viz","owner":"zombie-einstein","description":"Jaxpr Visualisation Tool","archived":false,"fork":false,"pushed_at":"2024-12-22T14:57:01.000Z","size":433,"stargazers_count":28,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-29T13:43:53.192Z","etag":null,"topics":["computation-graph","graph","graphviz","jax","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zombie-einstein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-19T17:36:16.000Z","updated_at":"2025-05-11T07:37:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"b506d6b0-975f-4291-bf2b-33104074fc8c","html_url":"https://github.com/zombie-einstein/jaxpr-viz","commit_stats":null,"previous_names":["zombie-einstein/jaxpr-viz"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/zombie-einstein/jaxpr-viz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombie-einstein%2Fjaxpr-viz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombie-einstein%2Fjaxpr-viz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombie-einstein%2Fjaxpr-viz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombie-einstein%2Fjaxpr-viz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zombie-einstein","download_url":"https://codeload.github.com/zombie-einstein/jaxpr-viz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombie-einstein%2Fjaxpr-viz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computation-graph","graph","graphviz","jax","visualization"],"created_at":"2026-01-18T09:25:55.478Z","updated_at":"2026-01-18T09:25:56.025Z","avatar_url":"https://github.com/zombie-einstein.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jaxpr-Viz\n\nJAX Computation Graph Visualisation Tool\n\nJAX has built-in functionality to visualise the\nHLO graph generated by JAX, but I've found this rather\nlow-level for some use-cases.\n\nThe intention of this package is to visualise how\nsub-functions are connected in JAX programs. It does\nthis by converting the [JaxPr](https://jax.readthedocs.io/en/latest/jaxpr.html)\nrepresentation into a pydot graph. See [here](.github/docs/gallery.md)\nfor examples.\n\n\u003e **NOTE:** This project is still at an early stage and may not\n\u003e support all JAX functionality (or permutations thereof). If you spot\n\u003e some strange behaviour please create a [Github issue](https://github.com/zombie-einstein/jaxpr-viz/issues).\n\n## Installation\n\nInstall with pip:\n\n```bash\npip install jpviz\n```\n\nDependent on your system you may also need to install [Graphviz](https://www.graphviz.org/)\n\n## Usage\n\nJaxpr-viz can be used to visualise jit compiled (and nested)\nfunctions. It wraps jit compiled functions, which when called\nwith concrete values returns a [pydot](https://github.com/pydot/pydot)\ngraph.\n\nFor example this simple computation graph\n\n```python\nimport jax\nimport jax.numpy as jnp\n\nimport jpviz\n\n@jax.jit\ndef foo(x):\n    return 2 * x\n\n@jax.jit\ndef bar(x):\n    x = foo(x)\n    return x - 1\n\n# Wrap function and call with concrete arguments\n#  here dot_graph is a pydot object\ndot_graph = jpviz.draw(bar)(jnp.arange(10))\n# This renders the graph to a png file\ndot_graph.write_png(\"computation_graph.png\")\n```\n\nproduces this image\n\n![bar computation graph](.github/images/bar_collapsed.png)\n\nPydot has a number of options for rendering graphs, see\n[here](https://github.com/pydot/pydot#output).\n\n\u003e **NOTE:** For sub-functions to show as nodes/sub-graphs they\n\u003e need to be marked with `@jax.jit`, otherwise they will just\n\u003e merged into thir parent graph.\n\n### Jupyter Notebook\n\nTo show the rendered graph in a jupyter notebook you can use the\nhelper function `view_pydot`\n\n```python\n...\ndot_graph = jpviz.draw(bar)(jnp.arange(10))\njpviz.view_pydot(dot)\n```\n\n### Visualisation Options\n\n#### Collapse Nodes\nBy default, functions that are composed of only primitive functions\nare collapsed into a single node (like `foo` in the above example).\nThe full computation graph can be rendered using the `collapse_primitives`\nflag, setting it to `False` in the above example\n\n```python\n...\ndot_graph = jpviz.draw(bar, collapse_primitives=False)(jnp.arange(10))\n...\n```\n\nproduces\n\n![bar computation graph](.github/images/bar_expanded.png)\n\n#### Show Types\n\nBy default, type information is included in the node labels, this\ncan be hidden using the `show_avals` flag, setting it to `False`\n\n```python\n...\ndot_graph = jpviz.draw(bar, show_avals=False)(jnp.arange(10))\n...\n```\n\nproduces\n\n![bar computation graph](.github/images/bar_no_types.png \"Title\")\n\n\u003e **NOTE:** The labels of the nodes don't currently correspond\n\u003e to argument/variable names in the original Python code. Since\n\u003e JAX unpacks arguments/outputs to tuples they do correspond\n\u003e to the positioning of arguments and outputs.\n\n## Examples\n\nSee [here](.github/docs/gallery.md) for more examples of rendered computation graphs.\n\n## Developers\n\nDeveloper notes can be found [here](.github/docs/developers.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombie-einstein%2Fjaxpr-viz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzombie-einstein%2Fjaxpr-viz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombie-einstein%2Fjaxpr-viz/lists"}