Skip to content

Commit b7969a8

Browse files
Merge pull request #3 from coolguy525/dev
Update project documentation and task organization
2 parents 2e0186e + 4bcf35a commit b7969a8

2 files changed

Lines changed: 86 additions & 27 deletions

File tree

README.md

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,71 @@
1-
# rknpu2-rs
1+
# RKNN
22

3-
Rust bindings for the [Rockchip RKNN API (rknpu2)](https://github.com/airockchip/rknn-toolkit2), targeting deployment of deep learning models on Rockchip NPUs.
3+
Rust bindings for the Rockchip RKNN Runtime API (librknnrt.so), enabling deployment of deep learning models on Rockchip NPUs. This library is a key component of the rknpu2 SDK, providing efficient integration between Rust applications and Rockchip's neural processing unit for optimized AI model execution.
44

55
> These bindings do **not** require redistributing the C headers from the Rockchip rknpu2 SDK. The sys crate contains bindgen bindings, but bindgen is not part of the build process.
66
77
## Requirements
88

9-
- Rockchip NPU compatible with librknnrt or librknnmrt libraries.
9+
- Rockchip NPU compatible with `librknnrt` or `librknnmrt` libraries
10+
- Rust 1.70+ (edition 2021)
1011

1112
## Features
1213

1314
- Safe and idiomatic Rust abstractions over the `librknnrt.so` C API
1415
- Support for loading models, setting inputs, running inference, and reading outputs
15-
- There will be Zero-copy input/output buffer support
16+
- Zero-copy input/output buffer support (planned)
1617
- Includes both low-level `-sys` bindings and higher-level wrappers
1718
- Based on the **rknpu2 SDK v2.3.2**
19+
- Comprehensive error handling with custom error types
20+
- Memory-safe tensor operations and buffer management
1821

19-
## Version Compatibility
2022

21-
These bindings are aligned with the **2.3.2** release of the RKNN API.
22-
[rknn C API v2.3.2 PDF](https://github.com/airockchip/rknn-toolkit2/blob/42aa1d426c0a9e0869b6374edba009f7208a1926/doc/04_Rockchip_RKNPU_API_Reference_RKNNRT_V2.3.2_EN.pdf)
23+
## Project Structure
2324

25+
```
26+
crates/
27+
├── rknpu2/ # High-level Rust API wrapper
28+
├── rknpu2-sys/ # Low-level FFI bindings
29+
└── rktensor/ # Tensor operations and utilities
30+
```
31+
32+
## Installation
33+
34+
Add the following to your `Cargo.toml`:
35+
36+
```toml
37+
[dependencies]
38+
rknpu2 = { git = "https://github.com/CodeVoyager15/RKNN", package = "rknpu2" }
39+
rktensor = { git = "https://github.com/CodeVoyager15/RKNN", package = "rktensor" }
40+
```
2441

2542
## Usage
2643

27-
Coming soon!
44+
Coming soon! The library will provide a simple and intuitive API for:
45+
46+
- Loading RKNN models
47+
- Setting input tensors
48+
- Running inference
49+
- Retrieving output results
50+
- Managing memory and buffers efficiently
51+
52+
## Examples
53+
54+
Check out the examples in `crates/rknpu2/examples/` for usage demonstrations.
55+
56+
## Development Status
57+
58+
This project is actively maintained and follows Rust best practices. Contributions are welcome!
59+
60+
## License
61+
62+
This project is licensed under either of
63+
64+
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
65+
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
66+
67+
at your option.
68+
69+
## Contributing
70+
71+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

TODOS.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
1-
## TODO
2-
3-
### Ergonomics
4-
5-
- Some of the error types have integers as part of their error message. I should have a way to match these integers to strings.
6-
7-
### Documentation
8-
9-
- Most docstrings are missing
10-
11-
### Testing
12-
13-
- I should use cargo-tarpaulin to ensure code coverage
14-
15-
### API coverage
16-
17-
- Missing coverage of custom_ops, matmul_api
18-
- Re-look at the API design of Tensor and TensorBuilder for Zero-Copy tensors
19-
- Need TensorType implementations for all supported data types
1+
# TODOs
2+
3+
## High Priority
4+
- [ ] Complete custom_ops and matmul_api coverage
5+
- [ ] Implement zero-copy tensor operations
6+
- [ ] Add all RKNN data types support
7+
- [ ] Map integer error codes to readable messages
8+
- [ ] Add comprehensive docstrings
9+
10+
## Medium Priority
11+
- [ ] Set up cargo-tarpaulin for code coverage
12+
- [ ] Add more examples beyond mobilenet
13+
- [ ] Implement async/await support
14+
- [ ] Add performance monitoring hooks
15+
- [ ] Create API reference documentation
16+
17+
## Low Priority
18+
- [ ] Add logging and tracing support
19+
- [ ] Create CLI tools for model validation
20+
- [ ] Integrate with Rust ML ecosystem
21+
- [ ] Add ONNX model format support
22+
- [ ] Implement batch inference
23+
24+
## Completed ✅
25+
- [x] Basic RKNN API bindings
26+
- [x] Model loading and inference
27+
- [x] Input/output tensor handling
28+
- [x] Error handling framework
29+
- [x] Basic examples (mobilenet)
30+
31+
## Notes
32+
- Focus on stability before advanced features
33+
- Maintain backward compatibility
34+
- Align with upstream RKNN API updates

0 commit comments

Comments
 (0)