{"id":25903865,"url":"https://github.com/deepseek-ai/DualPipe","last_synced_at":"2025-03-03T04:02:25.629Z","repository":{"id":279719523,"uuid":"939397443","full_name":"deepseek-ai/DualPipe","owner":"deepseek-ai","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-27T02:42:34.000Z","size":88,"stargazers_count":690,"open_issues_count":3,"forks_count":35,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-27T03:20:52.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/deepseek-ai.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":"2025-02-26T13:29:57.000Z","updated_at":"2025-02-27T03:20:18.000Z","dependencies_parsed_at":"2025-02-27T03:20:54.627Z","dependency_job_id":"bd78bf7f-2b69-4ded-9a3d-bcc881b61f38","html_url":"https://github.com/deepseek-ai/DualPipe","commit_stats":null,"previous_names":["deepseek-ai/dualpipe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepseek-ai%2FDualPipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepseek-ai%2FDualPipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepseek-ai%2FDualPipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepseek-ai%2FDualPipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepseek-ai","download_url":"https://codeload.github.com/deepseek-ai/DualPipe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241605770,"owners_count":19989610,"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":"2025-03-03T04:02:20.099Z","updated_at":"2025-03-03T04:02:25.618Z","avatar_url":"https://github.com/deepseek-ai.png","language":"Python","funding_links":[],"categories":["Python","📖Contents","News"],"sub_categories":["📖DeepSeek/Multi-head Latent Attention(MLA) ([©️back👆🏻](#paperlist))"],"readme":"# DualPipe\n\nDualPipe is an innovative bidirectional pipeline parallelism algorithm introduced in the [DeepSeek-V3 Technical Report](https://arxiv.org/pdf/2412.19437). It achieves full overlap of forward and backward computation-communication phases, also reducing pipeline bubbles. For detailed information on computation-communication overlap, please refer to the [profile data](https://github.com/deepseek-ai/profile-data).\n\n### Schedules\n\n![schedules](images/schedules.png)\n\nExample DualPipe scheduling for 8 PP ranks and 20 micro-batches in two directions.\nThe micro-batches in the reverse direction are symmetric to those in the forward direction, so\nwe omit their batch ID for illustration simplicity. Two cells enclosed by a shared black border\nhave mutually overlapped computation and communication\n\n### Pipeline Bubbles and Memory Usage Comparison\n\n| Method      | Bubble                          | Parameter | Activation |\n|-------------|---------------------------------|-----------|------------|\n| 1F1B        | (PP-1)(𝐹+𝐵)                     | 1×        | PP         |\n| ZB1P        | (PP-1)(𝐹+𝐵-2𝑊)                  | 1×        | PP         |\n| DualPipe    | (PP/2-1)(𝐹\u0026𝐵+𝐵-3𝑊)             | 2×        | PP+1       |\n\n𝐹 denotes the execution time of a forward chunk, 𝐵 denotes the execution time of a\nfull backward chunk, 𝑊 denotes the execution time of a \"backward for weights\" chunk, and 𝐹\u0026𝐵\ndenotes the execution time of two mutually overlapped forward and backward chunks.\n\n## Quick Start\n\nThe usage is shown in the following example:\n\n```bash\npython example.py\n```\n\nNote: For real-world applications, you will need to implement a custom `overlapped_forward_backward` method tailored to your specific module.\n\n## Requirements\n\n- PyTorch 2.0 and above\n\n## Developers\n\nDualPipe was created and developed by Jiashi Li and Chengqi Deng and Wenfeng Liang.\n\n## Citation\n\n```bibtex\n@misc{deepseekai2024deepseekv3technicalreport,\n      title={DeepSeek-V3 Technical Report}, \n      author={DeepSeek-AI},\n      year={2024},\n      eprint={2412.19437},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https://arxiv.org/abs/2412.19437}, \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepseek-ai%2FDualPipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepseek-ai%2FDualPipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepseek-ai%2FDualPipe/lists"}