{"id":13604207,"url":"https://github.com/MachineLearningSystem/piper","last_synced_at":"2025-04-11T23:31:58.046Z","repository":{"id":185461908,"uuid":"483715091","full_name":"MachineLearningSystem/piper","owner":"MachineLearningSystem","description":null,"archived":false,"fork":true,"pushed_at":"2021-12-18T19:11:49.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-07T08:42:25.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"msr-fiddle/piper","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MachineLearningSystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-04-20T15:41:24.000Z","updated_at":"2022-03-26T03:08:04.000Z","dependencies_parsed_at":"2023-08-02T03:17:01.015Z","dependency_job_id":null,"html_url":"https://github.com/MachineLearningSystem/piper","commit_stats":null,"previous_names":["machinelearningsystem/piper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2Fpiper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2Fpiper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2Fpiper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2Fpiper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MachineLearningSystem","download_url":"https://codeload.github.com/MachineLearningSystem/piper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248495049,"owners_count":21113556,"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":[],"created_at":"2024-08-01T19:00:41.639Z","updated_at":"2025-04-11T23:31:57.599Z","avatar_url":"https://github.com/MachineLearningSystem.png","language":null,"readme":"# Piper: Multidimensional Planner for DNN Parallelization - code\n\nThis code package contains algorithms (proof-of-concept implementation) and input files (profiled DNN models / workloads) from the paper \"Piper: Multidimensional Planner for DNN Parallelization\" published at NeurIPS 2021.\nIt allows one to reproduce the results in the paper, as well as run the partitioning algorithms on other workloads.\n\n## Input format\n\nAll our algorithms take as input a JSON file with the following format (all fields are mandatory unless indicated otherwise). This format closely follows our model (see Section 3 \"Problem Setup\" in the paper):\n* `maxMemoryPerDevice` (floating-point): a memory size limit of a single accelerator, in bytes,\n* `maxDevices` (integer): number of accelerators (`k` from the paper),\n* `maxBatchSize` (integer): maximum number of microbatches in a batch (`N` from the paper),\n* `bandwidth` (floating-point): bandwidth (from each device to the outside),\n* `nodes` (array): for each node (layer):\n    * `id` (integer): unique ID of node,\n    * `TMPCs` (dictionary): mapping from tensor-parallelism degree (`t`) to an array of TMPCs, each having:\n        * `id` (string): name,\n        * `timePerSample` (floating-point): compute latency (backward+forward, quantity `p` from the paper),\n        * `parameterSize` (floating-point): size of weights (to be used in computing data-parallel resync costs, quantity `w` from the paper),\n        * `memoryUsageA`, `memoryUsageB` (floating-point): memory usage coefficients `a` and `b` (see paper),\n        * `syncTimeFw` (dictionary): mapping from heads of outgoing edges to their parameters `c^fw` (see paper),\n        * `syncTimeBw` (dictionary): mapping from tails of incoming edges to their parameters `c^bw` (see paper),\n* `edges` (array): for each edge:\n    * `sourceId` (integer): the ID of the tail of the edge (edge from `sourceId` to `destId`),\n    * `destId` (integer): the ID of the head of the edge,\n    * `communicationCost` (floating-point): cost of transfer over this edge (in bytes).\n\nOther debug information may be present in the input files, such as `name`s on nodes.\n\n## Piper algorithm\n\nThe solution is implemented in `algo.cpp`. It is a single C++ file (using one header-only library for JSON parsing) and can be compiled with a recent version of `gcc` by running e.g. `g++ -O3 algo.cpp -o algo.exe`.\n\nThe compiled program runs experiments from the paper - see `main()` at the end of `algo.cpp`.\nIt is possible to run only a subset of the evaluations by simply commenting out some lines in `main()`.\nThe simplest mode of usage is shown in `single()`.\nThe main example input file is `inputs/bert32a100.json`.\n\n## Legal notices\n\n**Trademarks**\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\nor contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nWe use the [JSON for Modern C++](https://github.com/nlohmann/json) library, copyright (c) 2013-2020 Niels Lohmann, licensed under the MIT license.\n","funding_links":[],"categories":["Paper-Code"],"sub_categories":["Parallellism Training"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachineLearningSystem%2Fpiper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMachineLearningSystem%2Fpiper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachineLearningSystem%2Fpiper/lists"}