The Kneron Toolchain is a comprehensive software suite for converting, quantizing, and compiling neural networks. It is distributed as a Docker container to ensure a consistent, reproducible environment across all operating systems.
1. Architecture Overview
Understanding how the toolchain works will help you debug issues later.
[ Your Host Machine (Windows/Mac/Linux) ]
|
|-- [ Python Wrapper (pip install) ] <-- You interact with this
|
v
[ Docker Container (kneron/toolchain) ]
|-- Compiler (ONNX -> NEF)
|-- Quantizer (FP32 -> INT8)
|-- Simulator (x86 CPU Inference)
|
|-- [ Python Wrapper (pip install) ] <-- You interact with this
|
v
[ Docker Container (kneron/toolchain) ]
|-- Compiler (ONNX -> NEF)
|-- Quantizer (FP32 -> INT8)
|-- Simulator (x86 CPU Inference)
2. System Requirements
| Component | Requirement | Notes |
|---|---|---|
| CPU | x86_64 with AVX2 | Required for quantization accuracy. Apple M1/M2 users run via Rosetta 2 (slower). |
| RAM | 8GB (Min) / 16GB (Rec) | Transformer models (KL530) require significantly more memory during compilation. |
| Disk | 20GB Free | Docker images are large (~5GB uncompressed). |
| OS | Ubuntu 20.04+, Win 10+, macOS 12+ | Windows users MUST use WSL2 backend for Docker. |
3. Installing Docker Desktop
The toolchain requires a running Docker daemon.
4. Installation Methods
Choose the method that fits your workflow.
K-Code Extension (Recommended)
The easiest way to get started. K-Code handles the Docker pull and mounting automatically.
- Install "Kneron K-Code" from the VS Code Marketplace.
- Open the Kneron sidebar icon.
- Click "Initialize Environment".
Command Line Interface
For CI/CD pipelines or headless servers.
pip install kneron-toolchain
kneron install --version latest5. Verification
Run the environment check script to ensure the container can access your filesystem and CPU.
kneron check --verboseSuccess: Output should end with:
[OK] Toolchain v0.14.0 is ready. Host mount active.6. Troubleshooting
Make sure you have started the Docker Desktop application. On Linux, run
sudo systemctl start docker.Go to Docker Settings > Resources > File Sharing and ensure your project drive (C:) is checked.
This is expected. The compiler is x86 binary running via Rosetta 2 emulation. We are working on a native ARM64 build.