lnn-model-design

Audit and adapt neural network architectures for Linger quantization and Thinker NPU deployment.

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/LISTENAI/lnn_skills --skill lnn-model-design-listenai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lnn-model-design
Source: https://github.com/LISTENAI/lnn_skills/tree/main/lnn-model-design
Command: npx skills add https://github.com/LISTENAI/lnn_skills --skill lnn-model-design-listenai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires onnx, torch, and includes scripts (resource) and references (resource) components.

What problem does it solve? Deploying a neural network on LNN chips (venus, mars, arcs, venusa) often fails late in the cycle because of unsupported operators, precision mismatches, or memory limits in the Linger/Thinker toolchain. This Skill acts as an architecture gate that audits a model against real toolchain capabilities before training or deployment, and triages failures into structure, split-policy, threshold, or toolchain-defect categories. ## Core Features & Use Cases - Capability Discovery: Scans a local linger/ and thinker/ checkout to extract per-platform operators, precision support, SRAM/PSRAM limits, and tpacker defaults instead of relying on memory. - Static ONNX Audit: Inspects ONNX graphs for op support, dynamic axes, parameter bytes, and oversized tensors, mapping Linger quantized ops to Thinker equivalents. - End-to-End Gate: Runs Linger export, tpacker packaging, and tvalidator/runtime validation, then triages blockers and auto-generates minimal author issue bundles when the toolchain itself appears defective. - Use Case: A customer proposes a Conv2d+GRU model for the venusa platform with dynamic sequence length. The Skill audits the ONNX, runs tpacker with the declared dynamic shape, identifies a weight-chunk overflow, recommends a channel_out split, and verifies packaging passes. ## Quick Start Ask the assistant to evaluate your model architecture or ONNX file against a specific LNN target platform and input shape, for example by requesting a compatibility audit of model.onnx for the venusa platform.

Frequently Asked Questions about lnn-model-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my ONNX model is compatible with the Thinker NPU toolchain?

Run the inspect_onnx_model.py script with your ONNX file and a capabilities JSON generated from your local toolchain. It reports op support, dynamic axes, parameter sizes, and the largest tensors, then run_toolchain_gate.py can execute tpacker for a definitive packaging verdict.

How do I fix tpacker memory overflow errors on LNN platforms?

First classify the pressure as DMA buffer, workspace, or intermediate tensor using the memory report in the workspace directory. Then apply the split strategy: channel_out splits for oversized weights, h splits for oversized inputs, or threshold tuning in 64KB steps for workspace pressure.

Which operators does Linger quantization export support for Thinker deployment?

Supported quantized ops include QConv1d/QConv2d, QLinear, QGRU, QLSTM, QBmm, QLayerNorm, QSoftmax, and elementwise ops like QAdd, QMul, QCat, QSigmoid, and QTanh, which map to Thinker Int variants. The collect_toolchain_capabilities.py script extracts the exact per-platform list from your local toolchain source.

Can I evaluate a model without the Linger/Thinker toolchain installed?

Yes, the Skill supports an offline architecture-audit mode using built-in platform limits, operator support tables, memory thresholds, and split rules. Results are labeled as preflight guidance rather than final runtime proof, and you must still provide the target platform and input shape.

What should I do when tpacker or tvalidator fails with an internal assertion?

Treat internal assertions, invalid runtime parameters, or stable consistency mismatches on supported graphs as suspected toolchain defects rather than architecture problems. Run generate_author_issue_bundle.py to produce a minimal reproducible bundle with problem.md, repro.sh, logs, and checksums for the toolchain authors.

How do I handle dynamic input shapes when packaging for Thinker?

Declare dynamic axes with explicit min, max, and step values, and always evaluate against the maximum shape rather than typical runtime shapes. Pass the range to tpacker via --dynamic_shape and to tvalidator via --cfg, for example seq=32:384:32.