{"id":13686589,"url":"https://github.com/rodrgo/OpenPH","last_synced_at":"2025-05-01T09:32:17.811Z","repository":{"id":139140362,"uuid":"143002051","full_name":"rodrgo/OpenPH","owner":"rodrgo","description":"Parallel reduction of boundary matrices for Persistent Homology with CUDA","archived":false,"fork":false,"pushed_at":"2021-08-12T13:52:55.000Z","size":283,"stargazers_count":31,"open_issues_count":1,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-24T22:47:36.199Z","etag":null,"topics":["cuda","gpu-computing","numerical-computation","parallel-computing","persistent-homology","topological-data-analysis"],"latest_commit_sha":null,"homepage":"","language":"Cuda","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/rodrgo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-07-31T10:55:59.000Z","updated_at":"2024-12-17T21:14:40.000Z","dependencies_parsed_at":"2024-01-14T16:07:34.809Z","dependency_job_id":"89daeeb1-b0ae-4d38-8503-eb8f44825dee","html_url":"https://github.com/rodrgo/OpenPH","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrgo%2FOpenPH","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrgo%2FOpenPH/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrgo%2FOpenPH/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrgo%2FOpenPH/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrgo","download_url":"https://codeload.github.com/rodrgo/OpenPH/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251852845,"owners_count":21654475,"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":["cuda","gpu-computing","numerical-computation","parallel-computing","persistent-homology","topological-data-analysis"],"created_at":"2024-08-02T15:00:35.673Z","updated_at":"2025-05-01T09:32:17.529Z","avatar_url":"https://github.com/rodrgo.png","language":"Cuda","funding_links":[],"categories":["Cuda"],"sub_categories":[],"readme":"![image](https://drive.google.com/uc?export=view\u0026id=1_CLDwYxbgP3BpcfoSaa5ZypOHD37tRwz)\n\n[![GitNFT](https://img.shields.io/badge/%F0%9F%94%AE-Open%20in%20GitNFT-darkviolet?style=social)](https://gitnft.quine.sh/app/commits/list/repo/OpenPH)\n\n# OpenPH: Persistent Homology computation on GPUs\n\nOpenPH is a library for fast persistent homology computation on GPUs. OpenPH provides a `CUDA-C` implementation of `pms`, which is a provably convergent parallel algorithm for boundary matrix reduction tailored for GPUs, see the [Arxiv paper](https://arxiv.org/abs/1708.04710). Additionally, it includes vanilla implementations of other classical reduction algorithms like `standard`, `twist` and `ph-row`.\n\n## Installation\n\n### OpenPH\n\nThe following programs are required to build OpenPH: `make`, `python`, `nvcc`, `wget`, `matlab`. At this moment, `matlab` is the only interface for OpenPH, but we're working hard to make this project `matlab` independent. In particular, we plan to add `python` and `julia` APIs by release `1.0.0`.\n\nTo setup the project and build OpenPH for `matlab`, please run:\n\n```bash\nsh build.sh\n```\n\nThe script will do its best to automatically generate a `config` file (in the `src/matlab` folder) with your system and GPU parameters. If this fails, please look at `src/matlab` and fill in the blanks. \n\nBy default, OpenPH uses GPU `0`. An option to choose the GPU will be added in subsequent releases.\n\n### Numerics\n\nThe following programs are required to build the dependencies and run the numerics: `cmake`, `make`, `ant`, `java`, `openmp`, `epstopdf`.\n\nTo install the dependencies and run the numerics, please do\n\n```bash\ncd numerics\nbash install.sh\nbash run.sh\n```\n\nThe following libraries will be installed as the are needed to run the numerical experiments. The dependencies are listed below each library.\n\n* [Javaplex](https://github.com/appliedtopology/javaplex) - To generate pointclouds, simplicial complexes and boundary matrices.\n    * `java`, `ant`\n* [Phat](https://bitbucket.org/phat-code/phat) - Benchmarking baseline.\n    * `cmake`, `make`\n* [DIPHA](https://github.com/DIPHA/dipha) - Benchmarking datasets.\n    * `cmake`, `make`, `openmp`\n\n### Install all in one go and run experiments\n\nRun\n\n```bash\nsh build.sh\ncd numerics\nbash install.sh\nbash run.sh\n```\n\n## Overview\n\nThe current (vanilla) version of OpenPH uses a sparse representation of the boundary matrix (of dimension `m x m` that allocates a fixed number of memory slots per column. This induces a segmentation of the data that can be naturally split across `m` processors (one column per GPU thread) which permits a fast routine for column addition. Parallelisation is achieved by identifying a set of `pivots` (columns in the matrix that are already reduced) at the start of the algorithm and using them to apply a left-to-right column operation wherever possible. After each left-to-right column operation the algorithm checks whether the column can be added to the set of `pivots`. \n\nIt is shown in the numerical experiments that this strategy yields a very fast algorithm. However, in the current implementation, the number of memory slots per column has to be supplied at the beginning. In release `0.0.1` a value of `p*MAX_NNZ` was chosen, where `MAX_NNZ` is the number of non-zeros of the *least sparse* column in the matrix at the start of the algorithm and `p` is an integer chosen heuristically. \n\nFixing memory slots uniformly is not only sub-optimal from the storage complexity point of view, but can also make the algorithm unstable if the number of non-zeros in a given column grows beyond `p*MAX_NNZ` during reduction. The main objectives prior to release `1.0.0` are:\n\n1. To improve storge complexity by reassigning memory adaptively.\n2. To remove the need to supply `p`.\n3. To provide `python` and `julia` APIs to the low-level `C` code.\n4. Improve user experience (smarter installation, ability to choose GPU number, etc.)\n\n## Contributing\n\nPlease contribute to the project! :) Read above for an overview of the code and short-term goals or just add something different!\n\nDetailed contributing guidelines will be established in release `1.0.0`. If in the meantime, you wish to contribute, please feel free to do so by following the standard [fork \u0026 pull request workflow](https://gist.github.com/Chaser324/ce0505fbed06b947d962). If you intend to submit a contribution, it might be a good idea to open a [draft pull-request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) and [write us an email](mailto:r.mendozasmith@gmail.com) to discuss. \n\nAlso, feel free to write us an email if you want to contribute, but are not quite sure how to!\n\n## Citing\n\n```bibtex\n@article{mendoza2017parallel,\n  title={Parallel multi-scale reduction of persistent homology filtrations},\n  author={Mendoza-Smith, Rodrigo and Tanner, Jared},\n  journal={arXiv preprint arXiv:1708.04710},\n  year={2017}\n}\n```\n\n## License\n\n[Apache License 2.0](https://github.com/rodrgo/openph/blob/master/LICENSE)\n\nWe want everyone to use this code and to contribute to this project, but we also want to keep patent trolls away. This is why we picked an [Apache License 2.0](https://github.com/rodrgo/openph/blob/master/LICENSE) rather than a MIT license. If you have any questions or concerns about this license please [write us an email](mailto:r.mendozasmith@gmail.com).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrgo%2FOpenPH","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrgo%2FOpenPH","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrgo%2FOpenPH/lists"}