{"id":19454599,"url":"https://github.com/p4lang/p4app-switchml","last_synced_at":"2025-08-09T04:18:28.346Z","repository":{"id":43490080,"uuid":"329656109","full_name":"p4lang/p4app-switchML","owner":"p4lang","description":"Switch ML Application","archived":false,"fork":false,"pushed_at":"2022-07-15T03:23:37.000Z","size":355,"stargazers_count":184,"open_issues_count":13,"forks_count":52,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-04-25T05:36:29.262Z","etag":null,"topics":["collectives","dpdk","in-network-compute","machine-learning","p4","p4lang","rdma","tna","tofino"],"latest_commit_sha":null,"homepage":"https://switchml.readthedocs.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p4lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-14T15:30:00.000Z","updated_at":"2025-04-19T04:28:13.000Z","dependencies_parsed_at":"2022-08-12T10:41:41.660Z","dependency_job_id":null,"html_url":"https://github.com/p4lang/p4app-switchML","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/p4lang/p4app-switchML","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4lang%2Fp4app-switchML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4lang%2Fp4app-switchML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4lang%2Fp4app-switchML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4lang%2Fp4app-switchML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p4lang","download_url":"https://codeload.github.com/p4lang/p4app-switchML/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4lang%2Fp4app-switchML/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265228230,"owners_count":23731068,"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":["collectives","dpdk","in-network-compute","machine-learning","p4","p4lang","rdma","tna","tofino"],"created_at":"2024-11-10T17:10:24.343Z","updated_at":"2025-07-14T00:38:50.864Z","avatar_url":"https://github.com/p4lang.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwitchML: Switch-Based Training Acceleration for Machine Learning\n\nSwitchML accelerates the Allreduce communication primitive commonly used by distributed Machine Learning frameworks. It uses a programmable switch dataplane to perform in-network computation, reducing the volume of exchanged data by aggregating vectors (e.g., model updates) from  multiple  workers  in  the  network.  It provides an end-host library that can be integrated with ML frameworks to provide an efficient solution that speeds up training for a number of real-world benchmark models.\n\nThe switch hardware is programmed with a [P4 program](/dev_root/p4) for the [Tofino Native Architecture (TNA)](https://github.com/barefootnetworks/Open-Tofino) and managed at runtime through a [Python controller](/dev_root/controller) using BFRuntime. The [end-host library](/dev_root/client_lib) provides simple APIs to perform Allreduce operations using different transport protocols. We currently support UDP through DPDK and RDMA UC. The library has already been integrated with ML frameworks as a [NCCL plugin](/dev_root/frameworks_integration/nccl_plugin).\n\n## Getting started\nTo run SwitchML you need to:\n- compile the P4 program and deploy it on the switch (see the [P4 code documentation](/dev_root/p4))\n- run the Python controller (see the [controller documentation](/dev_root/controller))\n- compile and run the end-host program using the end-host library (see the [library documentation](/dev_root/client_lib))\n\nThe [examples](/dev_root/examples) folder provides simple programs that show how to use the APIs.\n\n## Repo organization\nThe SwitchML repository is organized as follows:\n\n```\ndocs: project documentation\ndev_root:\n  ┣ p4: P4 code for TNA\n  ┣ controller: switch controller program\n  ┣ client_lib: end-host library\n  ┣ examples: set of example programs\n  ┣ benchmarks: programs used to test raw performance\n  ┣ frameworks_integration: code to integrate with ML frameworks\n  ┣ third_party: third party software\n  ┣ protos: protobuf description for the interface between controller and end-host\n  ┗ scripts: helper scripts\n```\n\n## Testing\nThe [benchmarks](/dev_root/benchmarks) contain a benchmarks program that we used to measure SwitchML performances.\nIn our experiments (see benchmark documentation for details) we observed a more than 2x speedup over NCCL when using RDMA. Moreover, differently from ring Allreduce, with SwitchML performance are constant with any number of workers.\n\n![Benchmarks](/docs/img/benchmark.png)\n\n## Publication\n\n\u003e [Scaling Distributed Machine Learning with In-Network Aggregation\n\u003e A. Sapio, M. Canini, C.-Y. Ho, J. Nelson, P. Kalnis, C. Kim, A. Krishnamurthy, M. Moshref, D. R. K. Ports, P. Richtarik.\n\u003e In Proceedings of NSDI’21, Apr 2021.](https://www.usenix.org/conference/nsdi21/presentation/sapio)\n\n## Contributing\nThis project welcomes contributions and suggestions.\nTo learn more about making a contribution to SwitchML, please see our [Contribution](/CONTRIBUTING.md) page.\n\n## The Team\nSwitchML is a project driven by the [P4.org](https://p4.org) community and is currently maintained by Amedeo Sapio, Omar Alama, Marco Canini, Jacob Nelson.\n\n## License\nSwitchML is released with an Apache License 2.0, as found in the [LICENSE](/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4lang%2Fp4app-switchml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp4lang%2Fp4app-switchml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4lang%2Fp4app-switchml/lists"}