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

推荐订阅源

Google Online Security Blog
Google Online Security Blog
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
博客园 - 司徒正美
雷峰网
雷峰网
L
LINUX DO - 最新话题
博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
The Last Watchdog
The Last Watchdog
V2EX - 技术
V2EX - 技术
S
Security Affairs
有赞技术团队
有赞技术团队
月光博客
月光博客
T
Threatpost
T
Tor Project blog
O
OpenAI News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
V2EX
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
博客园 - 三生石上(FineUI控件)
D
Docker
AWS News Blog
AWS News Blog
AI
AI
P
Proofpoint News Feed
K
Kaspersky official blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Securelist
F
Fortinet All Blogs
F
Full Disclosure
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
量子位
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Palo Alto Networks Blog
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
美团技术团队
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog

Hacker News

Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line Building a Z-Machine in the worst possible language High-Level Rust: Getting 80% of the Benefits with 20% of the Pain GitHub - duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. How to build a `git diff` driver · Jamie Tanna | Software Engineer Center for Responsible, Decentralized Intelligence at Berkeley The Local Universe’s Expansion Rate Is Clearer Than Ever, but Still Doesn’t Add Up - A new synthesis of astronomical measurements confirms a persistent mismatch that could point to physics beyond current models The air throughout our homes is infused with microplastics. But there are things you can do to breathe less of them The disturbing white paper Red Hat is trying to erase from the internet – OSnews The Future of Everything is Lies, I Guess: Annoyances ‘Abhorrent’: the inside story of the Polymarket gamblers betting millions on war Productive procrastination — Max van IJsselmuiden maps, territory and LMs 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job The Seasons are Wrong Artemis II crew splashes down near San Diego after historic moon mission We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs How a dancer with ALS used brainwaves to perform live On filing the corners off my MacBooks Installing every* Firefox extension OpenClaw’s memory is unreliable, and you don’t know when it will break Steve Blank Nowhere Is Safe Chimpanzees in Uganda locked in vicious 'civil war', say researchers watgo - a WebAssembly Toolkit for Go linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. Founding Product Engineer at Bild AI | Y Combinator A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace Cooperative Vectors Introduction | Evolve Keeping a Postgres queue healthy — PlanetScale Our response to the Axios developer tool compromise Do Americans read print books, e-books or audiobooks more? The Zettelkasten Method in Obsidian: A Practical Setup Guide Artemis II Is Competency Porn and We Are Starving For It WeakC4 Flight Viz — Cockpit View A Mexican surveillance giant you’ve never heard of is now watching the U.S. border Surelock: Deadlock-Free Mutexes for Rust RISC-V 101 – what is it and what does it mean for Canonical? | Ubuntu The Problem That Built an Industry How Much Linear Memory Access Is Enough? | Solidean Investigating Split Locks on x86-64 Simplest hash functions Sybilproof reputation mechanisms (2005) [pdf] What is a property? How Complex is my Code? Static code analysis in Kotlin — tools overview Toffoli gates are all you need PGLite evangelism dcmake: a new CMake debugger UI Clojure on Fennel part one: Persistent Data Structures Fragments: April 2 Python Release Python install manager 26.1 The Life and Death of the Book Review - Liberties Introducing Database Traffic Control — PlanetScale Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Building slogbox Apple Silicon and Virtual Machines: Beating the 2 VM Limit Who was “Not Even Wrong” first? Pokemon Evolution Vs Darwinian Evolution The APL Programming Language Source Code
Open-Source Low-Overhead NVIDIA CUDA PC Sampling | Polar Signals
Tommy Reilly · 2026-06-15 · via Hacker News

One of the more powerful features of the CUDA Profiling Tools Interface (CUPTI) is support for Program Counter (PC) sampling. This lets developers of CUDA programs see where their code is spending time down to the instruction level. Building upon our support for kernel timing information, we've added the ability for our low-overhead continuous profiler to send PC sample data to our backend where it can be analyzed using the Polar Signals UI or run through your favorite LLM model using our MCP support. PC sampling is typically used in developer-oriented workflows with tools like NVidia NSight and Triton's Proton profiler, but with our approach to minimizing overhead it's actually possible to use it in production! But first, what is PC sampling and how does it work?

If you're just interested in trying this, this work is available in the v0.48.0 release of the open source Parca Agent. Check out this blog post on how to try it out on Kubernetes.

PC Sampling was introduced in the Maxwell architecture and had a simple API that piggy-backed on the CUPTI activity API. When the Volta architecture came out a new dedicated API for PC sampling was introduced. PC sampling works via dedicated hardware per-warp, on every sampling tick the state of each warp is recorded. The sampling interval is based on a power of 2 sampling factor where the hardware samples every 2^SAMPLING_FACTOR GPU cycles. The sampling factor is constrained to the range 5 to 31, so we could be taking a sample every 32 cycles (2^5) or only once every couple billion (2^31), tens of millions of samples a second at one extreme, barely one a second at the other. Quite the range! For our purposes we found 20 to be a good default sampling factor but of course it's configurable. That's a raw hardware rate of over 2k samples/s which may seem high for a "low-overhead" continuous profiler but depending on your application and GPU utilization the amount of data can be much less. That's because PC sampling records a PC offset/stall reason "bucket" and every time a sample is taken it's just incrementing the counter on that bucket. So no call stacks, no timestamps, just a pc offset / stall-reason pair.

Basically the pc/stall-reason information is collected in hardware, counters go up, and then periodically this information is flushed from the hardware buffers out to software buffers (all low-level stuff handled by CUPTI and the driver). We can configure this buffer size but the real trick is getting this information out of the buffer and into our CUPTI shim library. If you didn't commit the information from our prior blog posts to memory the way it works is your CUDA application is run with an env var (CUDA_INJECTION64_PATH) set to our shim library and it handles initializing CUPTI and listening for information about GPU happenings.

For PC sampling it works like this:

PC Sampling Overview

The real power of PC sampling is that it's not just recording the PC, it's the stall reason that comes with it, meaning that if the instruction at that cycle is (or is not) being issued the reason will be recorded. It's like if you had a CPU profiler that told you, down to the instruction level, if the instruction was retired normally or it had to wait on a pipeline stall, a cache miss or coherency delays. In GPU land there are a multitude of stall reasons but the main ones are "long scoreboard" memory latency dependencies (waiting on loads) or "short scoreboard" latency waiting on shared memory or specialized functional unit results. But there can also be queuing stalls (waiting for busy functional units to open up), synchronization barriers/memory fences etc. Similar to a CPU just a bigger menu of options.

The Polar Signals profiler takes the guess work out of understanding these stall reasons by including a brief explanation and linking to NVIDIA documentation for deeper understanding (see screenshot below).

A GB10 chip like the DGX Spark has 48 streaming multiprocessors (SMs) with 48 warps/SM which means it's sampling 2304 warps in parallel! Many levers are needed to deal with that much information! We've already talked about the sampling factor and how data is rolled up into PC/stall-reason pairs. Another lever we have is the PC sampling collection mode. PC sampling can be done in a "continuous" mode or a "kernel-serialized" mode. You'd think a continuous profiler would want to use continuous mode, but continuous mode makes attribution of samples to a particular kernel launch impossible: a GPU handles multiple kernel launches in parallel and schedules them as aggressively as it can, so you could end up with two kernel launches that share some of the same underlying CUDA binaries (cubins) both contributing to the same pc/stall-reason pairs. To take the guess work out of this we use kernel-serialized mode, which as you probably surmised, kills performance hard. So how do we make a continuous production mode profiler when we're killing performance? By sampling the samples!

Turns out you can enable/disable PC sampling pretty quickly so we have a dynamic algorithm that periodically turns on PC sampling for short intervals (~50ms) and then turns it off again where the delay between is tuned to get a target number of PC/stall reason pairs per second. By default we target 100/s (again also configurable) which seems to work well in practice. For simple GPU workloads there may be very little time between intervals, and for intense PyTorch training workloads there may be many seconds between sampling intervals.

So we know how to get the data off the hardware and into our shim library, but how do we efficiently get it over the network back to the collection service? Simple, we piggy back on our existing work and utilize USDT probes to allow our agent to place hooks into the shim library and extract all the goods.

Here are the new probes we added to support PC sampling:

And here's how everything is wired together:

There's a subtle problem hiding in that probe table. A pc_sample_batch record is useless on its own, to make sense of it you need the stall_reason_map (to decode the stall indices), the cubin_loaded bytes (to turn a PC offset back into source), and the gpu_config (to convert samples to time). But those are one-shot events. The stall reason map is emitted once at startup, and cubins fire as they're loaded, often long before anyone is watching.

Remember there's no coordination between the shim and the agent. The shim just fires these probes and does very little processing on the information other than to batch things up conveniently (you wouldn't want a BPF probe to fire on every single PC sample). This is great from a division-of-labor perspective, but it makes things tricky. What if the agent attaches mid-workload?

Typically the Polar Signals agent will be running 24/7 like a fly on the wall but customers will sometimes change label configs and restart for upgrades, and it's also the case that some of these PyTorch training workloads can run for a very long time (as we saw in my last blog). So we think it's important to handle this case.

Without going into excruciating detail basically what we do is listen and record the USDT semaphore counts on our probes which allows us to know when clients attach/detach from the probes and when this occurs we re-send cached stall reason maps and CUBIN information.

The agent installs BPF programs on all of these probes, feeding the stream of events into a BPF ring buffer for processing. The one real trick it has to play is caching kernel launches: PC samples show up after the fact tagged only with a correlation ID, so the agent keeps a cache of recent launches and matches each batch of samples back to the application stack that launched that kernel. We take the PC and stall reason and attach them as "labels" on the stack sample that can be grouped or filtered:

screen shot of PC sampling flamegraph

From there the samples are packed into Apache Arrow records for efficient transmission to the server. One nice property that falls out of how PC sampling works: because the data is already reported as counts, each pc/stall-reason bucket carries the number of times it was sampled, meaning there's nothing to deduplicate. The agent and backend can simply add buckets together as they arrive.

The last piece is symbolization. Rather than resolve instructions to source on the host, which would mean burning cycles inside the profiled process, the agent uploads each cubin to our debuginfo service and we symbolize on the backend. The wrinkle is that cubins don't ship with standard DWARF debug info mapping SASS instructions back to source lines, so we can't lean on the usual symbolization tooling. Instead we crack open the cubin, disassemble it, and build our own address-to-source tables to turn a pc offset back into a function, file, and line. Just be sure to include the -lineinfo flag on your nvcc command line (seen screenshot above for an example).

PC sampling has traditionally been confined to interactive, developer-time tools like NSight and Proton because of its overhead. By sampling the samples, replaying metadata so a late-attaching agent never misses the context it needs, and pushing symbolization to the backend, we've gotten it down to something you can leave running in production. The result is instruction-level GPU insight, right down to why a warp stalled, alongside the call stacks and kernel timings you already get from the Polar Signals continuous profiler.

You can get started with our free 14-Day trial today. If you're on Kubernetes, check out how to get started within just a few minutes without modifying your workload.