hexagon-optimization
Skill by alibaba
Guides optimization, refactoring, builds and regression testing of the MNN Hexagon DSP backend. It is for engineers changing the Hexagon, HVX and HMX code paths in MNN.
Install hexagon-optimization
Built from the published package, never by AI.
git clone --depth 1 https://github.com/alibaba/MNN /tmp/MNN && mkdir -p ~/.claude/skills && cp -r /tmp/MNN/skills/hexagon ~/.claude/skills/hexagon-optimizationRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/alibaba/MNN /tmp/MNN && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/MNN/skills/hexagon ~/.gemini/antigravity-cli/skills/hexagon-optimizationAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install hexagon-optimization in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill covers the MNN Hexagon, HVX and HMX DSP backend in source/backend/hexagon. It describes how to optimize, refactor, build and verify changes to that backend. It also covers device-based phase breakdowns, measurement rules, differences between the v79 and v81 architectures, common bottleneck patterns, rejected optimization directions and cDSP crash diagnosis.
The skill sets hard rules. It forbids CPU fallback as an optimization and forbids operator fusion unless the user lifts that limit. Code paths must be chosen by device properties rather than environment variables. Changes are measured with gated profilers, compared using DSPOpType numbers, and checked on both architectures before claims are made. It is intended for engineers who modify the MNN Hexagon DSP code.
Written from the project's SKILL.md and checked against it.
What it can do
- Phase profilingUses gated profilers to break down prefill GEMM, attention and worker time by phase.
- Measurement disciplineRules for noise bands, device cooling, alternating A/B runs and best-of-N estimates.
- Build and syncCommands to rebuild the host and DSP libraries and push them to the Android build directory.
- Architecture comparisonNotes on v79 and v81 differences, including HMX lock modes and wave quantization effects.
- Bottleneck patternsCatalog of measured bottlenecks such as DMA fixed latency, DDR traffic and HVX register pressure.
- Ablation testingMethod to measure the ceiling of an optimization by bypassing a whole operator section.
- cDSP crash diagnosisCovers diagnosing cDSP and qurt crashes and device disconnects during DSP tests.
- Library verificationSteps to confirm the library on the device matches the build, using md5 and behavior checks.
What you need
- Qualcomm Hexagon DSP device with v79 or v81 architecture
- Android device connected over adb
- Android build directory at project/android/build_64
- Remote build host with a Hexagon SDK environment setup script
Try asking
- Profile the Hexagon prefill GEMM phases and tell me the biggest bottleneck.
- Rebuild the DSP library for v81 and verify its md5 on the device.
- Run an A/B test of this Hexagon change, alternating runs and reporting noise.
Good to know
- Forbids CPU fallback and operator fusion as optimizations unless the user lifts the limit.
- DSP builds are not reproducible, so an md5 cannot confirm which source is on the device.
- Building for a non-connected architecture can overwrite the v81 FastRPC stub unless adb is blocked.
- Profiler gates add overhead, so profiled numbers must not be used for throughput comparisons.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/hexagon/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md46 KB -
agents/openai.yaml248 B
Alternatives to hexagon-optimization
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
hexagon-optimization: common questions
Can this skill be used for MNN Hexagon DSP optimization?
Yes. It covers optimization, refactoring, building and regression testing of the MNN Hexagon DSP backend in source/backend/hexagon.
Which Hexagon architectures does it cover?
It covers the v79 and v81 architectures, including the differences between them and how to build for each.
Does it allow moving work from Hexagon to the CPU for speed?
No. The skill forbids CPU fallback as an optimization and requires that backend ownership stay on Hexagon.
How do I install hexagon-optimization?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is hexagon-optimization free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is hexagon-optimization safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to hexagon-optimization?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
