{"id":21389480,"url":"https://github.com/feifeibear/improved-baidu-allreduce","last_synced_at":"2025-03-16T12:46:53.644Z","repository":{"id":85016976,"uuid":"118975700","full_name":"feifeibear/Improved-Baidu-Allreduce","owner":"feifeibear","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-28T04:47:14.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T00:41:16.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/feifeibear.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":"2018-01-25T22:34:30.000Z","updated_at":"2018-01-27T02:00:47.000Z","dependencies_parsed_at":"2023-04-09T04:33:43.854Z","dependency_job_id":null,"html_url":"https://github.com/feifeibear/Improved-Baidu-Allreduce","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeibear%2FImproved-Baidu-Allreduce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeibear%2FImproved-Baidu-Allreduce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeibear%2FImproved-Baidu-Allreduce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeibear%2FImproved-Baidu-Allreduce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feifeibear","download_url":"https://codeload.github.com/feifeibear/Improved-Baidu-Allreduce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871652,"owners_count":20361378,"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-11-22T12:26:41.540Z","updated_at":"2025-03-16T12:46:53.621Z","avatar_url":"https://github.com/feifeibear.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Improvement Allreduce`\nImprove BaiduAllreduce for large-scale DNN.\n\n# `baidu-allreduce`\n\n`baidu-allreduce` is a small C++ library, demonstrating the ring allreduce and\nring allgather techniques. The goal is to provide a template for deep learning\nframework authors to use when implementing these communication algorithms\nwithin their respective frameworks.\n\nA description of the ring allreduce with its application to deep learning is\navailable on the [Baidu SVAIL blog](http://research.baidu.com/bringing-hpc-techniques-deep-learning/).\n\n## Installation\n\n**Prerequisites:** Before compiling `baidu-allreduce`, make sure you have\ninstalled CUDA (7.5 or greater) and an MPI implementation.\n\n`baidu-allreduce` has been tested with [OpenMPI](https://www.open-mpi.org/),\nbut should work with any CUDA-aware MPI implementation, such as MVAPICH.\n\nTo compile `baidu-allreduce`, run\n\n```bash\n# Modify MPI_ROOT to point to your installation of MPI.\n# You should see $MPI_ROOT/include/mpi.h and $MPI_ROOT/lib/libmpi.so.\n# Modify CUDA_ROOT to point to your installation of CUDA.\nmake MPI_ROOT=/usr/lib/openmpi CUDA_ROOT=/path/to/cuda/lib64\n```\n\nYou may need to modify your `LD_LIBRARY_PATH` environment variable to point to\nyour MPI implementation as well as your CUDA libraries.\n\nTo run the `baidu-allreduce` tests after compiling it, run\n```bash\n# On CPU.\nmpirun --np 3 allreduce-test cpu\n\n# On GPU. Requires a CUDA-aware MPI implementation.\nmpirun --np 3 allreduce-test gpu\n```\n\n## Interface\n\nThe `baidu-allreduce` library provides the following C++ functions:\n\n```c++\n// Initialize the library, including MPI and if necessary the CUDA device.\n// If device == NO_DEVICE, no GPU is used; otherwise, the device specifies which CUDA\n// device should be used. All data passed to other functions must be on that device.\n#define NO_DEVICE -1\nvoid InitCollectives(int device);\n\n// The ring allreduce. The lengths of the data chunks passed to this function\n// must be the same across all MPI processes. The output memory will be\n// allocated and written into `output`.\nvoid RingAllreduce(float* data, size_t length, float** output);\n\n// The ring allgather. The lengths of the data chunks passed to this function\n// may differ across different devices. The output memory will be allocated and\n// written into `output`.\nvoid RingAllgather(float* data, size_t length, float** output);\n```\n\nThe interface is simple and inflexible and is meant as a demonstration. The\ncode is fairly straightforward and the same technique can be integrated into\nexisting codebases in a variety of ways.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeifeibear%2Fimproved-baidu-allreduce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeifeibear%2Fimproved-baidu-allreduce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeifeibear%2Fimproved-baidu-allreduce/lists"}