{"id":32659889,"url":"https://github.com/erosiv/silt","last_synced_at":"2025-10-31T15:03:01.322Z","repository":{"id":321433871,"uuid":"1055616485","full_name":"erosiv/silt","owner":"erosiv","description":"simple immediate lightweight tensors","archived":false,"fork":false,"pushed_at":"2025-10-29T15:26:26.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T17:33:39.864Z","etag":null,"topics":["cmake","cuda","simulation","tensor"],"latest_commit_sha":null,"homepage":"https://erosiv.studio/docs/silt","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erosiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-12T14:29:56.000Z","updated_at":"2025-10-29T15:26:30.000Z","dependencies_parsed_at":"2025-10-29T17:35:12.441Z","dependency_job_id":null,"html_url":"https://github.com/erosiv/silt","commit_stats":null,"previous_names":["erosiv/silt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/erosiv/silt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erosiv%2Fsilt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erosiv%2Fsilt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erosiv%2Fsilt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erosiv%2Fsilt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erosiv","download_url":"https://codeload.github.com/erosiv/silt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erosiv%2Fsilt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282007156,"owners_count":26598240,"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-10-31T02:00:07.401Z","response_time":57,"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":["cmake","cuda","simulation","tensor"],"created_at":"2025-10-31T15:01:35.554Z","updated_at":"2025-10-31T15:03:01.317Z","avatar_url":"https://github.com/erosiv.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# silt\n\nsimple immediate lightweight tensors\n\n[Link to Full Documentation](https://erosiv.studio/docs/silt)\n\n## What is silt?\n\nsilt is an isolated lightweight tensor library for easy inclusion in projects that use CUDA with Python bindings. silt is designed for passing around tensor data between various libraries and into kernels on the GPU for physics simulation.\n\nsilt is designed to be trivially includable as a git submodule in projects that use a build-system based on ``CMake`` and CUDA (``nvcc``) with python bindings. This enables the designing of **non-monolithic tensor accelerated libraries**.\n\nIn essence, silt represents a specific, minimal compilation setup or a kind of `minimal boilerplate glue` that improves build times while keeping interoperability without code duplication.\n\nsilt is just over 2000 lines of code (with python bindings), making it extremely legible. In other words, you don't have to use silt, but if you also like to roll your own, then you can at least easily understand its structure and fork it.\n\n## Features\n\n- `silt` supports both CPU and GPU tensors based on CUDA.\n- `silt` is interoperable with python numpy and pytorch tensors.\n- `silt` provides a basic set of common immediate-evaluation tensor operations.\n- `silt` supports 1-4 dimensional tensors, intended for physics simulations.\n- `silt` is fully statically compiled in C++/CUDA while polymorphic in the python interface\n\nThe goal is to be super lightweight with minimal compile times and easy inclusion into CMake projects via git submodules.\n\nNote that this library doesn't implement complicated operations or features like autodifferentiation to provide a clean interface and minimal implementation.\n\n## Usage\n\n### Install Python Module\n\n*coming soon to PyPI.org*\n\n### Typical Use-Case\n\nA common use case is to write a small library containing a templated kernel operation:\n\n```c++\n#include \u003csilt/silt.hpp\u003e\n#include \u003csilt/core/tensor.hpp\u003e\n\ntemplate\u003ctypename T\u003e\n__global__ __kernel(tensor_t\u003cT\u003e tensor);\n\ntemplate\u003ctypename T\u003e\nvoid my_tensor_operation(silt::tensor_t\u003cT\u003e\u0026 tensor) {\n  __kernel\u003c\u003c\u003cblock, thread\u003e\u003e\u003e(tensor);\n}\n```\n\nExposed through bindings with ``nanobind``, your library (and all other libraries built with silt) can now operate on silt tensors.\n\n```python\nimport silt, mylib, otherlib\n\nshape = silt.shape(1024, 1024)\ntensor = silt.tensor(shape, silt.float32, silt.gpu)\n\nmylib.my_tensor_operation(tensor)\notherlib.their_tensor_operation(tensor)\n```\n\nFinally, silt takes care of details around memory allocation and deallocation, move and copy semantics, as well as conversion between polymorphic python types and strict-typed C++. silt allows you to no-copy convert tensors on the CPU and GPU to popular libraries like ``numpy`` and ``pytorch``.\n\n## Build from Scratch\n\n### Build Python Module\n\nInstall `silt` using `pip`:\n\n```bash\npip install .\n```\n\nNo build-isolation progressive build (development):\n\n```bash\npip install --no-build-isolation -ve .\n```\n\nBuild a distributable `.whl` file:\n\n```bash\npip wheel .\n```\n\n### Adding as a C++ Dependency\n\nAdd silt as a submodule dependency to your repository:\n\n```bash\ngit submodule add git@github.com:erosiv/silt.git ext/silt\ngit submodule update --init --recursive\n```\n\nAdd the subdirectory to your `CMakeLists.txt` and link the library:\n\n```CMakeLists.txt\nadd_subdirectory(${CMAKE_SOURCE_DIR}/ext/silt silt)\ntarget_link_libraries(${TARGET_NAME} PUBLIC silt_lib)\n```\n\nNote that when you use `silt` as a dependency in a separate project's python bindings, it is interoperable with other libraries that use `silt`.\n\n### Build Documentation\n\nThe documentation is build with sphinx:\n\n```bash\nsphinx-build doc build/html\n```\n\n## Why another tensor library?\n\n`silt` was spun out of the tensor component of `soillib`, as more projects became dependent on it.\n\nThese projects have the same underlying goal: A polymorphic python interface for fast iteration and modular composition, with fully static C++ kernels for high performance. I found myself copy-pasting the same boilerplate over and over, so I decided to spin it out.\n\nThese projects also all share a similar build structure with similar goals: A CMake pipeline to build a C++/CUDA shared library, and python bindings with nanobind. With that in mind, this is designed to be included as a drop-in git submodule that *just works*.\n\nI find that other projects are often unnecessarily large for monolithic kernel development, when all I really need is a small interface to convert data from various places on the python side, and provide a simple templated interface in C++.\n\nBesides, sometimes it's just fun to roll your own. I would rather spend more time designing and building a small library like this than fighting build errors on somebody else's code.\n\n## ToDo List\n\nFind a way to further reduce the requirement for explicit template instantiations if possible.\n\nOptional: Non-GLM Vector Types\n  The ultimate goal is to FULLY eliminate the GLM types from the dependencies,\n  because they are causing major portability issues withw windows for no benefit.\n\nOptional: Orderings\n  Introduce an ordering type that uses things like e.g. morton \n  order to turn a linear index into a non-linear index.\n\n  Introduce an ordering type that allows for copy-free transposition\n\nOptional: Sparsity\n  Tensor Bags as more Complex Composed Maps\n  Then, a map type can compose multiple of these together into weird structures including\n  sparse structures, etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferosiv%2Fsilt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferosiv%2Fsilt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferosiv%2Fsilt/lists"}