{"id":30842777,"url":"https://github.com/tum-ei-eda/utvm_staticrt_codegen","last_synced_at":"2025-09-06T21:07:59.489Z","repository":{"id":47413169,"uuid":"333351104","full_name":"tum-ei-eda/utvm_staticrt_codegen","owner":"tum-ei-eda","description":"This project contains a code generator that produces static C NN inference deployment code targeting tiny micro-controllers (TinyML) as replacement for other µTVM runtimes. This tools generates a runtime, which statically executes the compiled model. This reduces the overhead in terms of code size and execution time compared to having a dynamic on-device runtime.","archived":false,"fork":false,"pushed_at":"2021-09-22T09:50:54.000Z","size":658,"stargazers_count":30,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T16:58:15.576Z","etag":null,"topics":["tvm"],"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/tum-ei-eda.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}},"created_at":"2021-01-27T08:20:45.000Z","updated_at":"2025-06-24T18:16:21.000Z","dependencies_parsed_at":"2022-08-23T01:20:14.141Z","dependency_job_id":null,"html_url":"https://github.com/tum-ei-eda/utvm_staticrt_codegen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tum-ei-eda/utvm_staticrt_codegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tum-ei-eda%2Futvm_staticrt_codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tum-ei-eda%2Futvm_staticrt_codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tum-ei-eda%2Futvm_staticrt_codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tum-ei-eda%2Futvm_staticrt_codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tum-ei-eda","download_url":"https://codeload.github.com/tum-ei-eda/utvm_staticrt_codegen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tum-ei-eda%2Futvm_staticrt_codegen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273962601,"owners_count":25198600,"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-09-06T02:00:13.247Z","response_time":2576,"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":["tvm"],"created_at":"2025-09-06T21:07:58.506Z","updated_at":"2025-09-06T21:07:59.480Z","avatar_url":"https://github.com/tum-ei-eda.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# µTVM StaticRT CodeGen\n\nThis project contains a code generator that produces static C NN inference deployment code targeting tiny micro-controllers (TinyML) as replacement for other µTVM runtimes. This tools generates a runtime, which statically executes the compiled model.  This reduces the overhead in terms of code size and execution time compared to having a dynamic on-device runtime.\n\n![Tool flow](doc/flow.png)\n\n\n## Requirements\n\n- Install required system packages\n- Install required python packages\n- Clone TVM\n- Apply patches in `tvm_patches/`\n- Build TVM\n\nFor detailed commands see [CI Config](.github/workflows/ci.yml).\n\n## Building\n\nThe generator is a conventional CMake project.\n\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n    cmake --build .\n\n## Usage\n\n- Point python to the TVM installation:\n\n      export PYTHONPATH=../tvm/python:${PYTHONPATH}\n\n- Generate a `graph.json`, `params.bin` and `kernels.c` file for your model with µTVM. A complete example is shown in [this µTVM example script](examples/utvm_gen_graph_and_params.py).\n\n- Inspect `kernels.c` and determine the required workspace size by looking at the `TVMBackendAllocWorkspace` calls and picking the largest used byte size. If there are no calls, the size should be zero.\n\n- Execute the µTVM StaticRT CodeGen:\n\n      ./utvm_staticrt_codegen graph.json params.bin staticrt.c $WORKSPACE_SIZE\n\n- Now the `kernels.c` and `staticrt.c` can be compiled together with some calling code into a complete application. An example is given in `examples/target_src/`.\n\nFor detailed commands see [example full flow script](examples/run_flow.sh).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftum-ei-eda%2Futvm_staticrt_codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftum-ei-eda%2Futvm_staticrt_codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftum-ei-eda%2Futvm_staticrt_codegen/lists"}