{"id":23084759,"url":"https://github.com/vc-bonn/charonload","last_synced_at":"2025-08-16T02:32:25.417Z","repository":{"id":219914379,"uuid":"749883414","full_name":"vc-bonn/charonload","owner":"vc-bonn","description":"Develop C++/CUDA extensions with PyTorch like Python scripts","archived":false,"fork":false,"pushed_at":"2024-11-15T19:41:16.000Z","size":518,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-16T03:50:57.585Z","etag":null,"topics":["cmake","cpp","cuda","jit","python","pytorch","torch"],"latest_commit_sha":null,"homepage":"https://vc-bonn.github.io/charonload/","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/vc-bonn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-01-29T15:33:26.000Z","updated_at":"2024-11-15T19:41:19.000Z","dependencies_parsed_at":"2024-07-29T11:59:25.682Z","dependency_job_id":"7342aae0-3639-4a99-be85-7b352c2279cd","html_url":"https://github.com/vc-bonn/charonload","commit_stats":null,"previous_names":["vc-bonn/charonload"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-bonn%2Fcharonload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-bonn%2Fcharonload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-bonn%2Fcharonload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-bonn%2Fcharonload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vc-bonn","download_url":"https://codeload.github.com/vc-bonn/charonload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229995647,"owners_count":18156848,"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":["cmake","cpp","cuda","jit","python","pytorch","torch"],"created_at":"2024-12-16T16:44:00.440Z","updated_at":"2024-12-16T16:44:01.071Z","avatar_url":"https://github.com/vc-bonn.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003eCharonLoad\u003c/h1\u003e\n\n\u003c!-- start readme --\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pypi.python.org/pypi/charonload\"\u003e\n    \u003cimg alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/charonload\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.python.org/pypi/charonload\"\u003e\n    \u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/charonload\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/vc-bonn/charonload/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/vc-bonn/charonload\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/vc-bonn/charonload/actions/workflows/tests.yml\"\u003e\n    \u003cimg alt=\"Tests\" src=\"https://github.com/vc-bonn/charonload/actions/workflows/tests.yml/badge.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/vc-bonn/charonload/actions/workflows/lint.yml\"\u003e\n    \u003cimg alt=\"Lint\" src=\"https://github.com/vc-bonn/charonload/actions/workflows/lint.yml/badge.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://vc-bonn.github.io/charonload\"\u003e\n    \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/docs-Latest-green.svg\"/\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\nCharonLoad is a bridge between Python code and rapidly developed custom C++/CUDA extensions to make writing **high-performance research code** with *PyTorch* easy:\n\n- 🔥 PyTorch C++ API detection and linking\n- 🔨 Automatic just-in-time (JIT) compilation of the C++/CUDA part\n- 📦 Cached incremental builds and automatic clean builds\n- 🔗 Full power of CMake for handling C++ dependencies\n- ⌨️ Python stub file generation for syntax highlighting and auto-completion in VS Code\n- 🐛 Interactive mixed Python/C++ debugging support in VS Code via *Python C++ Debugger* extension\n\nCharonLoad reduces the burden to start writing and experimenting with custom GPU kernels in PyTorch by getting complex boilerplate code and common pitfalls out of your way. Developing C++/CUDA code with CharonLoad feels similar to writing Python scripts and lets you follow the same familiar workflow.\n\n\n## Installation\n\nCharonLoad requires **Python \u003e=3.9** and can be installed from PyPI:\n\n```sh\npip install charonload\n```\n\n\n## Quick Start\n\nCharonLoad only requires minimal changes to existing projects. In particular, a small configuration of the C++/CUDA project is added in the Python part while the CMake and C++ part should adopt some predefined functions:\n\n- `\u003cyour_project\u003e/main.py`\n  \n    ```python\n    import charonload\n\n    VSCODE_STUBS_DIRECTORY = pathlib.Path(__file__).parent / \"typings\"\n\n    charonload.module_config[\"my_cpp_cuda_ext\"] = charonload.Config(\n        project_directory=pathlib.Path(__file__).parent / \"\u003cmy_cpp_cuda_ext\u003e\",\n        build_directory=\"custom/build/directory\",  # optional\n        stubs_directory=VSCODE_STUBS_DIRECTORY,  # optional\n    )\n\n    import other_module\n    ```\n\n- `\u003cyour_project\u003e/other_module.py`\n  \n    ```python\n    import my_cpp_cuda_ext  # JIT compiles and loads the extension\n\n    tensor_from_ext = my_cpp_cuda_ext.generate_tensor()\n    ```\n\n- `\u003cyour_project\u003e/\u003cmy_cpp_cuda_ext\u003e/CMakeLists.txt`\n  \n    ```cmake\n    find_package(charonload)\n\n    if(charonload_FOUND)\n        charonload_add_torch_library(${TORCH_EXTENSION_NAME} MODULE)\n\n        target_sources(${TORCH_EXTENSION_NAME} PRIVATE src/\u003cmy_bindings\u003e.cpp)\n        # Further properties, e.g. link against other 3rd-party libraries, etc.\n        # ...\n    endif()\n    ```\n\n- ``\u003cyour_project\u003e/\u003cmy_cpp_cuda_ext\u003e/src/\u003cmy_bindings\u003e.cpp``\n\n    ```cpp\n    #include \u003ctorch/python.h\u003e\n\n    torch::Tensor generate_tensor();  // Implemented somewhere in \u003cmy_cpp_cuda_ext\u003e\n\n    PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)\n    {\n        m.def(\"generate_tensor\", \u0026generate_tensor, \"Optional Python docstring\");\n    }\n    ```\n\n\n## Contributing\n\nIf you would like to contribute to CharonLoad, you can find more information in the [Contributing](https://vc-bonn.github.io/charonload/src/contributing.html) guide.\n\n\n## License\n\nMIT\n\n\n## Contact\n\nPatrick Stotko - \u003ca href=\"mailto:stotko@cs.uni-bonn.de\"\u003estotko@cs.uni-bonn.de\u003c/a\u003e\u003cbr/\u003e\n\n\u003c!-- end readme --\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvc-bonn%2Fcharonload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvc-bonn%2Fcharonload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvc-bonn%2Fcharonload/lists"}