{"id":19288346,"url":"https://github.com/techascent/tvm-clj","last_synced_at":"2025-12-12T01:19:56.979Z","repository":{"id":56177297,"uuid":"121677841","full_name":"techascent/tvm-clj","owner":"techascent","description":"clojure tvm bindings and exploration","archived":false,"fork":false,"pushed_at":"2022-08-25T08:22:35.000Z","size":4183,"stargazers_count":97,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-23T11:34:08.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techascent.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}},"created_at":"2018-02-15T20:16:07.000Z","updated_at":"2025-01-22T00:56:40.000Z","dependencies_parsed_at":"2022-08-15T14:10:22.112Z","dependency_job_id":null,"html_url":"https://github.com/techascent/tvm-clj","commit_stats":null,"previous_names":["tech-ascent/tvm-clj"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/techascent/tvm-clj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftvm-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftvm-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftvm-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftvm-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techascent","download_url":"https://codeload.github.com/techascent/tvm-clj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techascent%2Ftvm-clj/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261006163,"owners_count":23095995,"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-09T22:08:46.215Z","updated_at":"2025-12-12T01:19:51.912Z","avatar_url":"https://github.com/techascent.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tvm-clj\n\nClojure bindings and exploration of the [tvm](https://github.com/apache/incubator-tvm) library.\n\nTVM is a high performance compiler for ND numeric code.  In it's simplest form, it works via\n4 steps: \n\n1.  Define an AST.\n2.  Schedule the AST, doing things such as tiling and operation or caching a partial\n    result in GPU shared memory.  This allows us to make transformations to the algorithm which\n        allow us to map the algorithm to specific hardware such as GPU's, FPGA's, web-based\n\tbackends such as wasm, graphics backends such as OpenGL and Vulkan and low powered IoT\n\tplatforms such as [microcontrollers](https://tvm.apache.org/2020/06/04/tinyml-how-tvm-is-taming-tiny).\n\tThese transformations are are guaranteed not to break the algorithm so they are very safe from\n\ta correctness viewpoint but also allow powerful vectorizing, SIMD, and \n\t[SIMT](https://en.wikipedia.org/wiki/Single_instruction,_multiple_threads) optimizations.\n3.  Compile the AST to a specific hardware profile.  TVM has backends to a \n    [wide variety of hardware](https://github.com/apache/incubator-tvm/blob/main/python/tvm/_ffi/runtime_ctypes.py#L156)\n\tincluding, as mentioned, extremely optimized versions for x86 and ARM CPUs, Cuda, and OpenCL.\n4.  Load your function and call it.\n\n\n\n* [API Documents](https://techascent.github.io/tvm-clj/)\n* [simple tests](test/tvm_clj/tvm_test.clj)\n\n\n## Getting all the source\n\nAt top level:\n```bash\ngit submodule update --init --recursive\n```\n\n## Building TVM\n\n```bash\nsudo apt install make g++ cmake llvm-dev libopenblas-dev\n\n## opencl support (nvidia-cuda includes this)\nsudo apt install ocl-icd-* opencl-headers\n\n## Cuda support\nsudo apt install  nvidia-cuda-toolkit\n\n## intel graphics adapter support\nsudo apt install beignet beignet-opencl-icd\n\n\n## MKL support if you choose.  I don't use it generally so this is very optional.\ncurl https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | sudo apt-key add -\nsudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main \u003e /etc/apt/sources.list.d/intel-mkl.list'\nsudo apt-get update\n## Find the version of mkl...I would take the latest.\napt-cache search mkl-64bit\n## ...\nsudo apt-get install intel-mkl-64bit-2019.5-075\n\n\nmkdir -p tvm/build\n# Config setup for intel and such.\n# Base config.cmake file only has support for opencl.  If you want\n# CUDA, CUDNN, or MKL I suggest you edit the config file after you copy\n# it.\ncp config.cmake tvm/build/\n\ncd tvm/build\n\ncmake ..\nmake -j8\n\n\n```\n\nThis will copy the libs into a platform-specific directory that jna should find.\n\nAnother options is to install the tvm libs themselves.  We recommend this pathway as\nthen the tvm libraries will work with the python bindings.  In fact, it can be worth it\nto install the python bindings as there are a lot of examples in python that are\ninstructive to work with.\n\n\n## More Information\n\n\n* [background theoretical documentation](topics/background.md)\n\n\n## License\n\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechascent%2Ftvm-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechascent%2Ftvm-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechascent%2Ftvm-clj/lists"}