Heterogeneous compute means one system running several kinds of processing unit, such as CPUs, GPUs, DSPs or application-specific accelerators, with each one able to take part in the work. For inference, the useful way to read it is as a map. It shows which unit runs which part of the model, which memory each unit treats as its own, and what it costs to move a tensor from one side of a boundary to the other. Crossing a boundary adds transfer, mapping or synchronisation work. Splitting pays only when the bottleneck sits on a unit that the split actually relieves.
Heterogeneous Compute in an Inference Path: Units, Not Free Parallelism
For CPU inference, a few tens of fast out-of-order cores with large caches suit latency-critical work. GPUs use many in-order cores that share a control unit and suit throughput-critical work. NVIDIA’s CUDA guide gives the scale: a server with two 32-core processors runs 64 threads at once, while a GPU with 80 multiprocessors can keep more than 160,000 GPU threads active. Modern edge SoCs combine CPUs, integrated GPUs and NPUs, and NVIDIA Jetson AGX devices add a deep learning accelerator next to the CPU and GPU.
ML computations are typically represented as a directed acyclic graph of operators, and the scheduler decides where each node runs and in what order. Mapping happens at two levels. Frontend compilation produces the graph, and backend compilation assigns operators to processors and allocates memory for them. This is also why the GPU is better treated as one part of a larger system than as the whole story.
Who Owns Memory Across Each Compute-Unit Boundary?
A discrete GPU has its own physical memory, separate from the host’s, so data has to be copied between the two. With pageable host memory, the CUDA driver first stages data into a temporary pinned buffer and then transfers it, which adds an extra copy.
Heterogeneous System Architecture (HSA) aims to remove that split. It defines a unified virtual address space in which devices share page tables and pass pointers instead of copying data. The HSA Foundation’s 1.2 specification lists shared virtual memory, cache coherency domains, flat addressing and user-mode queues among the requirements for a compliant system. Compliance also depends on hardware: the CPU’s MMU and the GPU’s IOMMU must both meet the HSA specification.
“Shared address space” covers more than one design. NVIDIA’s unified memory documentation separates hardware-coherent systems, which share one page table across CPU and GPU (Grace Hopper is the example), from software-coherent systems, which keep separate page tables. On software-coherent systems, coherency is enforced through page faults, and a fault can migrate a physical page at a cost proportional to its size. Hardware-coherent systems resolve contention at cache-line granularity, so frequent concurrent CPU and GPU access to the same page faults less. Integrated GPUs share physical memory with the CPU, yet CUDA still keeps a logical distinction between host and device memory.
| Boundary | Who owns the memory | What a crossing costs |
|---|---|---|
| Discrete GPU over PCIe | Separate host and device memories | Explicit copies over the interconnect; pageable memory adds a staging copy |
| Software-coherent unified memory | Separate CPU and GPU page tables | Page faults and page migration on access from the other side |
| Hardware-coherent (for example Grace Hopper) | One page table across CPU and GPU | Coherence at cache-line granularity, fewer page faults |
| Unified-memory SoC (CPU, iGPU, NPU) | Unified memory shared by all units | No copies, but synchronisation, contention and data-type conversion remain |
| WASM sandbox on the CPU | The WASM heap | Buffer copies via toJs(), or in-place access via getBuffer() |
Unified memory does not make a split free. The HeteroMosaic authors (2026) say it directly: unified memory removes data-copy overhead but not coordination overhead, so whether a split pays still depends on contention, synchronisation and accelerator balance. CoDL’s authors found the same on mobile SoCs. Even with unified memory, keeping shared data coherent requires synchronisation, mapping and sometimes data-type conversion.
Where Does a WASM Python Runtime Sit, and What Does It Own?
A WebAssembly runtime is a sandboxed execution environment. Its compilers turn Wasm binaries into native code for CPU architectures such as x86_64. In a heterogeneous map, it is a placement on the CPU side, behind a sandbox, and not a route around the other units. The runtime provides memory allocation, stack operations and an interface to the host, which is JS glue code in the browser or WASI outside it.
Executing inside the sandbox costs speed, and that cost depends on the workload. A study cited in the 2024 Wasm runtime survey measured wasmer at 5 to 10 times slower than native execution. The survey traces the gap to more load and store instructions, extra branches for safety checks and more L1 instruction-cache misses. The ReFlux authors measured how much the cost varies by workload. A 256×256 matrix multiplication ran 4.22 times slower under WASM than native C, while a 64 MB memory copy ran at 0.74 times native time. ReFlux’s authors class dense numeric kernels with the matmul profile, on the expensive side of that gap. Our piece on the compile flags that carry to Emscripten covers how build settings shape a WASM build.
The second cost sits at the language boundary. In Pyodide, Python cannot directly use arrays that live outside the WASM heap. Data crossing into JavaScript is either copied, through toJs(), or read in place through getBuffer(), which gives low-level access to the WASM memory behind a buffer. Pyodide’s documentation warns that toJs() on a 1920×1080×4 image buffer will be extremely slow, while the same data laid out as 1920×4×1080 will most likely be fine. Our walkthrough of how Pyodide and WASM run Python covers the runtime itself.
None of the sources here measures the boundary cost between a WASM runtime and an accelerator through WebGPU or wasi-nn. Until someone profiles that path for a specific browser and model, we would treat any claimed speedup as unverified.
What Crossing a Boundary Costs for Inference
The gap between interconnect bandwidth and device-memory bandwidth is why placement matters. ONNX Runtime’s documentation notes that a recent GPU has about 1 TB/s of memory bandwidth, while a PCIe 4.0 x16 link to the CPU offers only about 32 GB/s. The ATSInfer authors (2026) describe the same mismatch on consumer GPUs: device memory runs from hundreds to over a thousand GB/s, against at most 32 GB/s over PCIe 4.0.
Measured bandwidth falls below the nominal figure. The authors of a KV-cache offloading study measured sustained PCIe bandwidth of 15 GB/s in their H100 PCIe 5.0 example. A 2026 prototype on an RTX 5080 over PCIe Gen5 x16 reached about 22 GB/s from GPU to CPU and 15 GB/s from CPU to GPU, which is 35% and 24% of the 63 GB/s theoretical peak. Its authors attribute both the low utilisation and the asymmetry to non-pinned memory. NVIDIA reports that pinned host allocations more than double transfer rates on typical systems.
Workloads that move a lot of data are limited by these numbers. In the KV-offloading study, 99% of latency went on transfers for a small document with more than 65K KV tokens, and the GPUs drew only 28% of their rated TDP. A profiling study of dynamic graph neural networks found memory copies took about 80% to 90% of GPU working time for MolDGNN, whatever the batch size. Small operators fail in a different way. CoDL’s authors measured an operator whose co-execution cut compute from 1126 µs to 599 µs, while data sharing added 1074 µs, a net 1.5× slowdown.
NVIDIA’s best-practices guide gives the rule underneath all of this: the work done per element transferred has to justify the transfer. Matrix addition, with a 1:3 ratio of operations to elements moved, gains little. Matrix multiplication, with an O(N) ratio, gains more as the matrices grow. Assigning adjacent layers to different devices adds transition latency, so keeping them on one device is sometimes the better choice.
In a Grace Hopper data-movement study, the C2C link is rated at 450 GB/s per direction, yet in the authors’ matrix-multiplication benchmark, moving one operand out of HBM turned a compute-bound workload heavily memory-bound, except for FP16 at cache-fitting sizes.
When Does Splitting an Inference Path Across CPU, GPU and Accelerators Pay?
HeteGen (2024) frames when a CPU-GPU tensor-parallel split pays as a balance condition: CPU compute time should equal GPU compute time plus communication time, T_CPU = T_GPU + T_COM. Its authors note that the ratio needs only measured execution times of the two operations.
Prefill is dominated by large matrix multiplications and bounded by GEMM throughput. Decode leans on matrix-vector products and KV-cache traffic and is often bounded by memory bandwidth. HeteroMosaic averaged 2.30×, 1.50× and 1.17× prefill speedups over an iGPU baseline across three Ryzen AI parts. The authors report smaller decode gains, especially where the system already ran near its bandwidth ceiling. ATSInfer’s authors report stage-specific transfer patterns. During prefill, a larger overlap window favoured moving more tensors to the GPU, while during decode the scheduler became more selective.
Splitting can also make things worse. In a study of heterogeneous mobile processors, µLayer’s CPU+GPU parallel inference of the FST model ran 1.9× to 3.1× slower than the GPU alone because of scheduling overhead. Unsupported operators push work back onto the CPU. For one ResNet-50 configuration on CPU and GPU, about 48% of operators were unsupported. FPGAs come with their own trade-offs. A 2026 study of the LLM memory-processing pipeline, on a GPU-FPGA system, found PCIe overhead roughly three orders of magnitude below end-to-end latency, because the methods that moved more data also computed for longer. FPGAs run streaming dataflow designs whose execution is data-driven, as our piece on OpenCL on FPGA explains.
| Situation | Likely verdict | Why |
|---|---|---|
| Code that cannot be parallelised enough | Keep it on the host | Unless that causes excessive host-device transfers |
| Weights exceed GPU memory, prefill-heavy | Split with overlapped transfers | Prefill leaves a larger window to overlap transfers |
| Decode-dominated, near the bandwidth ceiling | Expect small gains | Decode is bound by memory bandwidth |
| Lightweight model such as MobileNet | Expect little speedup from CPU-GPU co-execution | Sharing overhead dominates for small operators |
| Unified-memory SoC with a capable NPU | Worth calibrating empirically | Copies vanish, coordination does not |
| Accelerator lacks operators the model uses | Check fallback before splitting | Fallback idles units and adds transfers |
How Do We Profile a Heterogeneous Path to Confirm the Right Work Landed on the Right Unit Before Committing to a Port?
Profiling should answer which unit owns the bottleneck on a realistic input. NVIDIA’s guide calls a realistic workload the most important consideration in profiling.
- Run a realistic workload. Profiling decisions are only relevant to real data when the test workload is realistic.
- Exclude warm-up from the measurement. One profiling study found GPU warm-up took about 6.6 to 6.9 seconds, 33× to 86× the time of one inference step.
- Time transfers separately from kernels. NVIDIA advises tracking data-transfer time apart from kernel time, especially early in a port, when transfers can dominate.
- Label CPU regions with NVTX and read them in Nsight Systems. Nsight Systems projects NVTX ranges from CPU threads onto the GPU timeline, so you can see which GPU work each CPU region launched. ONNX Runtime recommends Nsight Systems for checking that asynchronous operations have not fallen back to synchronous execution.
- Break down operators with the PyTorch Profiler. With
ProfilerActivity.CPUandProfilerActivity.CUDAenabled, it records CPU-side operators and on-device CUDA kernels, andprofile_memoryreports tensor memory per operator. - Compute the transfer-to-kernel ratio. GUST (2026) divides transfer time by kernel time. Above a threshold of 1, a workload counts as transfer-intensive. At or below it, the workload counts as device-intensive.
- Accept a placement only if end-to-end latency improves. HeteroMosaic re-executes each proposed change and keeps it only if measured end-to-end latency improves, because a local gain does not guarantee a global one.
This baseline is what a performance and porting assessment before you commit to a migration supplies before a split is funded. We would fund a split on the profile, not on peak TOPS. HeteroMosaic’s authors make the same point: the best split cannot be inferred from peak TOPS or total arithmetic work.
Did Heterogeneity Relieve the Bottleneck or Just Relocate It?
The roofline model gives a test. A kernel’s attainable performance is the smaller of peak compute and memory bandwidth times operational intensity, so each kernel is either compute-bound or memory-bound. HeteroMosaic’s authors adapt the roofline model to accelerators sharing one memory system. A split operation cannot finish faster than its slowest participating accelerator or the shared memory system feeding them all. If a split raises one unit’s ceiling while another unit or the shared bus sets the real limit, the bottleneck has moved, not gone.
The sources show the bottleneck moving more than once. In GPU-centric offloading, PCIe limits throughput. ATSInfer runs part of the model on the CPU and then moves tensors back to the GPU to relieve the CPU bottleneck that results. KVPR’s authors (ACL Findings 2025) note that FastDecode runs attention on the CPU, so the CPU becomes the bottleneck under concurrent processes. GUST’s authors expect the same with fast host links: as NVLink reduces the host-memory bottleneck, it shifts to CPU preprocessing, NICs or NVMe storage.
In practice, we would re-profile after the split and compare per-unit time with the earlier profile. If transfer time fell but CPU time rose by a similar amount, or one unit now sits idle waiting on another, the split relocated the bottleneck. Our piece on when memory bandwidth is the bottleneck covers the memory-bound case in more depth.
Who Can Tell Us Whether Splitting Our Inference Path Will Pay?
TechnoLynx runs this placement analysis as a runtime-fit evaluation before a port is funded. It profiles where time goes on each compute unit and across each boundary, then tests whether a split across CPU, GPU, accelerator or WASM targets clears the latency target. Teams whose path serves a generative model will find related work under Generative & Agentic AI R&D. We would not recommend the engagement to a team whose profile already shows one unit owning the whole bottleneck. In that case, single-unit kernel tuning is the cheaper route, and an in-house engineer with Nsight Systems and the PyTorch Profiler can confirm it.
FAQ
Where Does Wasm Run?
WebAssembly runs in browsers, where it reaches the host through JavaScript glue code, and in standalone runtimes such as Wasmtime, which execute it outside the web. Runtimes such as WasmEdge are used in edge clouds, serverless APIs and embedded devices.