{"id":21995567,"url":"https://github.com/chriscummins/programl","last_synced_at":"2025-04-13T07:50:33.198Z","repository":{"id":41151859,"uuid":"223848498","full_name":"ChrisCummins/ProGraML","owner":"ChrisCummins","description":"A Graph-based Program Representation for Data Flow Analysis and Compiler Optimizations","archived":false,"fork":false,"pushed_at":"2024-05-22T23:14:58.000Z","size":53607,"stargazers_count":313,"open_issues_count":25,"forks_count":63,"subscribers_count":8,"default_branch":"development","last_synced_at":"2025-04-04T04:10:02.479Z","etag":null,"topics":["compiler-irs","control-flow","data-flow","graph-neural-networks","graph-representation","llvm","llvm-ir","machine-learning","programming-languages"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChrisCummins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2019-11-25T02:49:35.000Z","updated_at":"2025-04-02T19:51:58.000Z","dependencies_parsed_at":"2024-05-23T00:41:50.371Z","dependency_job_id":null,"html_url":"https://github.com/ChrisCummins/ProGraML","commit_stats":{"total_commits":1687,"total_committers":10,"mean_commits":168.7,"dds":0.03556609365737995,"last_synced_commit":"cd7d2939d485d989a9b105723fed989bcaca1f94"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisCummins%2FProGraML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisCummins%2FProGraML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisCummins%2FProGraML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisCummins%2FProGraML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChrisCummins","download_url":"https://codeload.github.com/ChrisCummins/ProGraML/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["compiler-irs","control-flow","data-flow","graph-neural-networks","graph-representation","llvm","llvm-ir","machine-learning","programming-languages"],"created_at":"2024-11-29T21:16:51.727Z","updated_at":"2025-04-13T07:50:33.169Z","avatar_url":"https://github.com/ChrisCummins.png","language":"C++","readme":"\u003ch1 align=\"center\"\u003eProGraML: Program Graphs for Machine Learning\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003c!-- PyPi Version --\u003e\n  \u003ca href=\"https://pypi.org/project/programl/\"\u003e\n      \u003cimg src=\"https://badge.fury.io/py/programl.svg\" alt=\"PyPI version\" height=\"20\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads counter --\u003e\n  \u003ca href=\"https://pypi.org/project/programl/\"\u003e\n      \u003cimg src=\"https://pepy.tech/badge/programl\" alt=\"PyPi Downloads\" height=\"20\"\u003e\n  \u003c/a\u003e\n  \u003c!-- license --\u003e\n  \u003ca href=\"https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)\"\u003e\n      \u003cimg src=\"https://img.shields.io/pypi/l/programl\" alt=\"License\" height=\"20\"\u003e\n  \u003c/a\u003e\n  \u003c!-- CI status --\u003e\n  \u003ca href=\"https://github.com/ChrisCummins/ProGraML/actions?query=workflow%3ACI+branch%3Astable\"\u003e\n    \u003cimg src=\"https://github.com/ChrisCummins/ProGraML/workflows/CI/badge.svg?branch=stable\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Better code --\u003e\n  \u003ca href=\"https://bettercodehub.com/results/ChrisCummins/ProGraML\"\u003e\n    \u003cimg src=\"https://bettercodehub.com/edge/badge/ChrisCummins/ProGraML?branch=stable\"\u003e\n  \u003c/a\u003e\n  \u003c!-- Commit counter --\u003e\n  \u003ca href=\"https://github.com/ChrisCummins/ProGraML/graphs/commit-activity\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/commit-activity/y/ChrisCummins/ProGraML.svg?color=yellow\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eAn expressive, language-independent representation of programs.\u003c/i\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ci\u003e\n    Check \u003ca href=\"https://chriscummins.cc/ProGraML\"\u003ethe website\u003c/a\u003e\n    for more information.\n  \u003c/i\u003e\n\u003c/p\u003e\n\n\n## Introduction\n\nProGraML is a representation for programs as input to a machine learning model.\nThe key features are:\n\n1. **Simple:** Everything is available through a `pip install`, no compilation\n   required. Supports several programming languages (*C, C++, LLVM-IR, XLA*) and\n   several graph formats (*NetworkX, DGL, Graphviz, JSON*) out of the box.\n\n2. **Expressive:** Captures every control, data, and call relation across entire\n   programs. The representation is independent of the source language. Features\n   and labels can be added at any granularity to support whole-program,\n   per-instruction, or per-relation reasoning tasks.\n\n3. **Fast:** The core graph construction is implemented in C++ with a low\n   overhead interface to Python. Every API method supports simple and efficient\n   parallelization through an `executor` parameter.\n\nTo get stuck in and play around with our graph representation, visit:\n\n\u003ca href=\"https://chriscummins.cc/s/program_explorer\"\u003e\n  \u003cimg height=\"400\" src=\"https://github.com/ChrisCummins/ProGraML/raw/development/Documentation/assets/program_explorer.png\"\u003e\n\u003c/a\u003e\n\nOr if papers are more your ☕, have a read of ours:\n\n\u003ca href=\"https://chriscummins.cc/pub/2021-icml.pdf\"\u003e\n  \u003cimg height=\"325\" src=\"https://github.com/ChrisCummins/ProGraML/raw/development/Documentation/icml-2021/paper.png\"\u003e\n\u003c/a\u003e\n\n\n## Supported Programming Languages\n\nThe following programming languages and compiler IRs are supported\nout-of-the-box:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eLanguage\u003c/th\u003e\n    \u003cth\u003eAPI Calls\u003c/th\u003e\n    \u003cth\u003eSupported Versions\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eC\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://chriscummins.cc/ProGraML/api/python.html#programl.from_cpp\"\u003e\u003ccode\u003eprograml.from_cpp()\u003c/code\u003e\u003c/a\u003e,\n      \u003ca href=\"https://chriscummins.cc/ProGraML/api/python.html#programl.from_clang\"\u003e\u003ccode\u003eprograml.from_clang()\u003c/code\u003e\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003eUp to ISO C 2017\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eC++\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://chriscummins.cc/ProGraML/api/python.html#programl.from_cpp\"\u003e\u003ccode\u003eprograml.from_cpp()\u003c/code\u003e\u003c/a\u003e,\n      \u003ca href=\"https://chriscummins.cc/ProGraML/api/python.html#programl.from_clang\"\u003e\u003ccode\u003eprograml.from_clang()\u003c/code\u003e\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003eUp to ISO C++ 2020 DIS\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eLLVM-IR\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://chriscummins.cc/ProGraML/api/python.html#programl.from_llvm_ir\"\u003e\u003ccode\u003eprograml.from_llvm_ir()\u003c/code\u003e\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e3.8.0, 6.0.0, 10.0.0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eXLA\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://chriscummins.cc/ProGraML/api/python.html#programl.from_xla_hlo_proto\"\u003e\u003ccode\u003eprograml.from_xla_hlo_proto()\u003c/code\u003e\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e2.0.0\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nIs your favorite language not supported here? Submit a [feature\nrequest](https://github.com/ChrisCummins/ProGraML/issues/new/choose)!\n\n\n## Getting Started\n\nInstall the latest release of the Python package using:\n\n```\npip install -U programl\n```\n\nThe API is very simple, comprising graph *creation* ops, graph *transform* ops,\nand graph *serialization* ops. Here is a quick demo of each:\n\n```py\n\u003e\u003e\u003e import programl as pg\n\n# Construct a program graph from C++:\n\u003e\u003e\u003e G = pg.from_cpp(\"\"\"\n... #include \u003ciostream\u003e\n...\n... int main(int argc, char** argv) {\n...   std::cout \u003c\u003c \"Hello, world!\" \u003c\u003c std::endl;\n...   return 0;\n... }\n... \"\"\")\n\n# A program graph is a protocol buffer:\n\u003e\u003e\u003e type(G).__name__\n'ProgramGraph'\n\n# Convert the graph to NetworkX:\n\u003e\u003e\u003e pg.to_networkx(G)\n\u003cnetworkx.classes.multidigraph.MultiDiGraph at 0x7fbcf40a2fa0\u003e\n\n# Save the graph for later:\n\u003e\u003e\u003e pg.save_graphs('file.data', [G])\n```\n\nFor further details check out the [API\nreference](https://chriscummins.cc/ProGraML/api/python.html).\n\n\n## Contributing\n\nPatches, bug reports, feature requests are welcome! Please use the\n[issue tracker](https://github.com/ChrisCummins/ProGraML/issues) to file a\nbug report or question. If you would like to help out with the code, please\nread [this document](CONTRIBUTING.md).\n\n\n## Citation\n\nIf you use ProGraML in any of your work, please cite [this\npaper](https://chriscummins.cc/pub/2021-icml.pdf):\n\n```\n@inproceedings{cummins2021a,\n  title={{ProGraML: A Graph-based Program Representation for Data Flow Analysis and Compiler Optimizations}},\n  author={Cummins, Chris and Fisches, Zacharias and Ben-Nun, Tal and Hoefler, Torsten and O'Boyle, Michael and Leather, Hugh},\n  booktitle = {Thirty-eighth International Conference on Machine Learning (ICML)},\n  year={2021}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriscummins%2Fprograml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchriscummins%2Fprograml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriscummins%2Fprograml/lists"}