{"id":20446362,"url":"https://github.com/ray-project/pygloo","last_synced_at":"2025-08-21T10:31:22.023Z","repository":{"id":42210594,"uuid":"337559500","full_name":"ray-project/pygloo","owner":"ray-project","description":"Pygloo provides Python bindings for Gloo.","archived":false,"fork":false,"pushed_at":"2025-07-07T15:54:08.000Z","size":82,"stargazers_count":21,"open_issues_count":6,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-16T12:56:23.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ray-project.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":"2021-02-09T22:59:36.000Z","updated_at":"2025-06-19T19:36:54.000Z","dependencies_parsed_at":"2024-12-19T22:08:20.785Z","dependency_job_id":"5347f17c-c40d-4aca-9867-b0eddcf2dc71","html_url":"https://github.com/ray-project/pygloo","commit_stats":{"total_commits":14,"total_committers":5,"mean_commits":2.8,"dds":0.6428571428571428,"last_synced_commit":"6667cbfc518ef73d0f23cc424d88aeedc4cefa9c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ray-project/pygloo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fpygloo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fpygloo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fpygloo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fpygloo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ray-project","download_url":"https://codeload.github.com/ray-project/pygloo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fpygloo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271462824,"owners_count":24764052,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-15T10:19:37.465Z","updated_at":"2025-08-21T10:31:21.709Z","avatar_url":"https://github.com/ray-project.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pygloo\n\nPygloo provides Python bindings for [gloo](https://github.com/facebookincubator/gloo).\nIt is implemented using [pybind11](https://github.com/pybind/pybind11).\n\nIt is currenlty used in [Ray for collective communication](https://github.com/ray-project/ray/tree/master/python/ray/util/collective) between CPUs.\n\n\n## Requirements\n```python\nPython \u003e= 3.6\n```\n\n## Installation\n### Install From Wheels\nWe provide prepackaged Python wheels (`manylinux2014_x86_64`,`manylinux_2_24_x86_64`). To install from wheels:\n```python\npip install pygloo\n```\n\n### Building from source\nOne can build pygloo from source if none of released wheels fit with the development environment.\n\nPygloo uses [Bazel](https://github.com/bazelbuild/bazel) to automatically manange dependencies and compilation.\nTo compile from source, install Bazel\u003e=2.0.0 following the [Bazel installation guide](https://docs.bazel.build/versions/master/install.html).\nAfter installing Bazel, build and install pygloo following this command:\n```python\npython setup.py install\n```\n\n## Testing\nPygloo uses [Ray](https://github.com/ray-project/ray) to create multiple, distributed processes for collective communication tests. See `tests` directory.\n\n## Example\nAn example for allreduce.\n```python\nimport os\nimport ray\nimport pygloo\nimport numpy as np\n\n@ray.remote(num_cpus=1)\ndef test_allreduce(rank, world_size, fileStore_path):\n    '''\n    rank  # Rank of this process within list of participating processes\n    world_size  # Number of participating processes\n    fileStore_path # The path to create filestore\n    '''\n    context = pygloo.rendezvous.Context(rank, world_size)\n    # Prepare device and store for rendezvous\n    attr = pygloo.transport.tcp.attr(\"localhost\")\n    dev = pygloo.transport.tcp.CreateDevice(attr)\n    fileStore = pygloo.rendezvous.FileStore(fileStore_path)\n    store = pygloo.rendezvous.PrefixStore(str(world_size), fileStore)\n\n    context.connectFullMesh(store, dev)\n\n    sendbuf = np.array([[1,2,3],[1,2,3]], dtype=np.float32)\n    recvbuf = np.zeros_like(sendbuf, dtype=np.float32)\n    sendptr = sendbuf.ctypes.data\n    recvptr = recvbuf.ctypes.data\n\n    pygloo.allreduce(context, sendptr, recvptr,\n                    sendbuf.size, pygloo.glooDataType_t.glooFloat32,\n                    pygloo.ReduceOp.SUM, pygloo.allreduceAlgorithm.RING)\n\nif __name__ == \"__main__\":\n    ray.init(num_cpus=6)\n    world_size = 2\n    fileStore_path = f\"{ray.worker._global_node.get_session_dir_path()}\" + \"/collective/gloo/rendezvous\"\n    os.makedirs(fileStore_path)\n    ray.get([test_allreduce.remote(rank, world_size, fileStore_path) for rank in range(world_size)])\n```\n\n\n## License\nGloo is licensed under the Apache License, Version 2.0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fray-project%2Fpygloo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fray-project%2Fpygloo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fray-project%2Fpygloo/lists"}