惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
S
Schneier on Security
T
Tenable Blog
G
GRAHAM CLULEY
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
I
Intezer
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
K
Kaspersky official blog
Blog — PlanetScale
Blog — PlanetScale
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threat Research - Cisco Blogs
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Palo Alto Networks Blog
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
The Cloudflare Blog
Help Net Security
Help Net Security
罗磊的独立博客
博客园 - 聂微东
Jina AI
Jina AI
Project Zero
Project Zero
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 最新话题
V
V2EX
人人都是产品经理
人人都是产品经理
美团技术团队
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
J
Java Code Geeks
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
The Last Watchdog
The Last Watchdog
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
S
Securelist
Forbes - Security
Forbes - Security
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
P
Privacy International News Feed
宝玉的分享
宝玉的分享
C
CERT Recently Published Vulnerability Notes

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How we catch silent NPU fallback on Snapdragon in CI (and why your eval set won't)
ashish-frozo · 2026-05-15 · via DEV Community

TL;DR — ONNX Runtime's QNN execution provider will quietly route unsupported ops to the CPU instead of the Hexagon NPU. Your accuracy is fine. Your eval set is fine. Median latency on a clean device looks fine. Then production traffic hits a different input distribution, more ops fall back, and p95 latency triples. The fix isn't more eval data — it's three CI assertions: run on real hardware, gate on median and coefficient of variation, and parse the ORT profiling output to assert what fraction of FLOPs actually ran on the NPU.


The pain

A team we work with ships a person-detection model on a robotics platform with a Snapdragon 8 Gen 3 SoC. The model is YOLOv8n, quantized to INT8 with AIMET, compiled through Qualcomm AI Hub, exported as an ONNX graph that ORT loads with the QNN execution provider targeting the Hexagon NPU in HTP performance mode.

Pre-merge they run a 5,000-image eval set on a development board. Latency: median 8.2 ms, p95 9.1 ms. Accuracy regresses by 0.3% from the FP32 baseline — well within tolerance. The PR merges. The model ships to ~400 devices in the field.

Three days later the support queue lights up. Field telemetry shows median inference at 24 ms, p95 at 41 ms, occasional spikes to 62 ms. The model isn't crashing. Accuracy is fine. It's just slow, slow enough to cause navigation hesitation, slow enough to miss frames at 30 fps. The team spends 9 engineering days reproducing the issue on a single board they can't make misbehave, before someone finally captures an ORT profiling trace and discovers that ~18% of the graph's FLOPs are running on the Kryo CPU, not the Hexagon NPU. A new LayerNormalization introduced in the latest YOLOv8 release isn't supported by the QNN backend on their firmware version. ORT logs a single line about it at startup and silently routes those nodes to CPU.

The eval set never caught it because the QNN backend cache was warm on the dev board, the input distribution didn't stress the unsupported path the same way, and nobody was watching the per-op routing manifest. The model "worked." It just worked on the wrong silicon.


Why standard solutions don't work

The instinct, after this kind of incident, is to widen the eval set. More images. More edge cases. More devices. That helps with accuracy regressions. It does almost nothing for NPU fallback regressions, because the failure mode isn't about what the model predicts, it's about where the model executes. Three specific things break down:

1. Cloud eval can't observe execution provider routing

If you eval in the cloud — on a workstation, on an x86 CI runner, in a Docker container with ORT compiled for CUDA or CPU — the QNN execution provider doesn't load. ORT silently runs the entire graph on whatever backend is available, and reports a clean 100% utilization on it. You learn nothing about Hexagon coverage. Even running on a Snapdragon emulator misses this: emulators implement the NPU instruction set in software, so every op is "supported," but for the wrong reason.

2. Median-of-N hides bimodal latency distributions

Most CI gating frameworks run inference N times (commonly 5 or 10), take the median, and compare against a threshold. The intuition is right — single runs are noisy, median smooths it out. But fallback creates a bimodal distribution: when the QNN scheduler hits a warm context binary cache, latency is fast; when it doesn't, latency is 3–8× slower because the fallback path involves a CPU↔NPU memory round-trip. With 10 samples, the median often lands on the fast cluster, the p95 lands on the slow cluster, and the gate (which only checks median) passes. You ship the regression.

The fix isn't to switch from median to mean — that just shifts which cluster wins. The fix is to gate on the coefficient of variation (CV) alongside the central tendency. A healthy on-NPU inference has CV around 2–5%. A graph with intermittent fallback has CV >15%. Set the gate to "median ≤ X and CV ≤ Y" and bimodal distributions fail.

3. ORT QNN EP doesn't surface per-op routing by default

This is the silent part. With default ORT logging (severity = WARNING), the only thing you see at session creation is a one-liner like:

[W:onnxruntime:Default, qnn_execution_provider.cc] 23 nodes assigned to QNNExecutionProvider, 7 nodes assigned to CPUExecutionProvider

Enter fullscreen mode Exit fullscreen mode

Nobody reads ORT startup logs in CI. There's no exception, no non-zero exit code, no metric exposed. The model loads, runs, and returns correct outputs. The 7 CPU nodes are buried in the verbose log stream alongside thread-pool warnings and tensor-shape inferences. You have to opt in to per-node routing diagnostics — set session_options.log_severity_level = 0 (VERBOSE) and provider_options["profiling_level"] = "detailed", then post-process the resulting profiling JSON to count what landed where.

Most teams never do this, because nothing in the standard ORT or QAI Hub developer flow tells them they should.


The three-part fix

Here's what actually catches NPU fallback regressions before they merge. None of these requires custom infrastructure beyond what ORT and Qualcomm AI Hub already give you.

Part 1: Run inference on the real device, not an emulator or a cloud proxy

This sounds tautological, but it's not common practice. Most teams use one of three substitutes for real hardware in CI:

  • Emulator / simulator (e.g., Hexagon SDK simulator) — implements the ISA but not the runtime scheduler, cache hierarchy, or thermal envelope. Useful for kernel correctness; useless for latency.
  • Cloud x86 with ORT-CPU — proves the graph runs, says nothing about NPU coverage.
  • Single dev board in someone's drawer — works until the dev board's firmware version diverges from the production fleet.

Qualcomm AI Hub gives you a hosted device farm: real chips, multiple firmware versions, schedulable from a script. Use it. Your CI should compile through AI Hub, submit a profiling job against the target device class, and wait for the metrics. The latency budget for this is 90–180 seconds per run, which is well within the budget of a normal PR check.

Part 2: Gate on median and coefficient of variation

Pseudocode that fits in a CI step:

def gate(latencies_ms, median_threshold, cv_threshold):
    median = statistics.median(latencies_ms)
    mean = statistics.mean(latencies_ms)
    stdev = statistics.stdev(latencies_ms)
    cv = (stdev / mean) * 100  # percent

    fails = []
    if median > median_threshold:
        fails.append(f"median {median:.2f}ms > {median_threshold}ms")
    if cv > cv_threshold:
        fails.append(
            f"CV {cv:.1f}% > {cv_threshold}% "
            f"(bimodal distribution — likely intermittent fallback)"
        )
    if fails:
        raise SystemExit("Latency gate failed: " + "; ".join(fails))

Enter fullscreen mode Exit fullscreen mode

We use median ≤ 10 ms, CV ≤ 8% as defaults for vision models on 8 Gen 3 HTP. Yours will differ — calibrate against a known-good baseline. The key is that both thresholds must hold. A model that satisfies the median but blows past the CV is the exact signature of partial fallback.

Sample size matters: you need ≥ 20 inference runs to compute a stable CV. Don't try this with N=5. We use N=30 with a 3-iteration warmup discarded to get past first-load cache misses.

Part 3: Assert per-op routing from the ORT profile

This is the diagnostic that would have caught the YOLOv8n incident in CI. Enable ORT profiling:

sess_options = onnxruntime.SessionOptions()
sess_options.enable_profiling = True
sess_options.log_severity_level = 0

provider_options = {
    "backend_path": "libQnnHtp.so",
    "profiling_level": "detailed",
    "htp_performance_mode": "burst",
}

session = onnxruntime.InferenceSession(
    model_path,
    sess_options,
    providers=[("QNNExecutionProvider", provider_options), "CPUExecutionProvider"],
)

Enter fullscreen mode Exit fullscreen mode

After the run, ORT drops a JSON profile next to your script. Each node entry tags which execution provider handled it. A post-run assertion:

import json
from collections import Counter

profile = json.load(open(profile_path))
op_routing = Counter()
flops_routing = Counter()

for ev in profile:
    if ev.get("cat") == "Node" and ev.get("args", {}).get("op_name"):
        ep = ev["args"].get("provider", "Unknown")
        op_routing[ep] += 1
        flops_routing[ep] += ev["args"].get("flops", 0)

total_flops = sum(flops_routing.values())
npu_pct = 100 * flops_routing["QNNExecutionProvider"] / total_flops
assert npu_pct >= 95, (
    f"Only {npu_pct:.1f}% of FLOPs on NPU; "
    f"CPU fell back on: {[op for op, ep in op_routing.items() if ep != 'QNNExecutionProvider']}"
)

Enter fullscreen mode Exit fullscreen mode

Two numbers matter: percentage of nodes on the NPU, and percentage of FLOPs on the NPU. A model can have 95% of nodes on the NPU but 60% of FLOPs on the CPU if the fallback ops are the heaviest ones. Always gate on FLOPs, not node count.

For us, the threshold is ≥ 98% of FLOPs on the QNN EP. Drop below that, the PR fails. The CI message tells the engineer exactly which op fell back, so they can either swap it for a supported equivalent (e.g., LayerNormalization → fused MatMul+Add patterns the QNN backend recognizes), pin the QNN SDK version, or escalate to firmware support.


Putting it together

The three checks compose. A PR run looks like:

  1. Compile the new model through Qualcomm AI Hub for the target chipset (~90s)
  2. Submit profiling job to the AI Hub device farm against, say, Snapdragon 8 Gen 3 reference + 7s Gen 2 fallback (~60s)
  3. Pull the ORT profile + latency series
  4. Assert median ≤ 10 ms, CV ≤ 8%, NPU FLOPs ≥ 98%
  5. Emit a signed evidence bundle so the release engineer can verify what was tested

Steps 1–4 take ~4 minutes per device. Step 5 is the audit trail. If any assertion fails, the PR check goes red and the engineer sees, in the GitHub UI, the exact op that fell back — not "model is slow" but LayerNormalization node /model.10/m.0/m.0.1/norm/LayerNormalization is on CPUExecutionProvider.

That single PR check has saved one of our customers 11 engineering days per quarter on average. Not because the bugs are rare — because catching them in the PR is a 20-minute fix and catching them in the field is a multi-week fire.


Where EdgeGate fits

We built EdgeGate because rolling all of this yourself — Qualcomm AI Hub orchestration, ORT profile parsing, CV-aware gating, signed evidence bundles, GitHub Action integration — is two or three engineer-weeks. It's the kind of infrastructure every team that ships edge AI eventually builds, and most build twice because the first version doesn't handle the firmware-version axis. If you'd rather not, we run the whole pipeline as a CI gate with a single YAML file. Free tier includes 10 runs/month on real Snapdragon hardware.

But honestly, if you take nothing else from this post: turn on profiling_level=detailed, parse the JSON, and assert NPU FLOP percentage. Three lines of Python, and you'll never ship a silent fallback again.


Originally published on edgegate.frozo.ai. Discuss in the comments — corner cases and code questions welcome.