Skip to content
Back to Blog

Running FAB and InstantHMR Without CUDA

Two new real-time body-mesh pipelines on an M3 Max: one had a Core ML path slower than the CPU, the other's SMPL fit crashed off CUDA.

Evyatar Bluzer10 min read

FAB's fitted body took 162 ms per person on my laptop's GPU, and 85 of those milliseconds were spent after the network had finished. On four CPU threads the same fit cost about 10 ms. That gap is most of what I learned from running this month's two open body-mesh releases on hardware neither paper measured.

TL;DR

  • FAB (arXiv:2611.25801) predicts dense 3D body points and fits SMPL to them afterwards; InstantHMR (arXiv:2611.09195) regresses body-model parameters directly and ships as ONNX graphs.
  • On an M3 Max laptop with 36GB, InstantHMR medium runs at 18 ms per person through Core ML, but only after a small patch to its Core ML setup; as released, its Core ML path is slower than four CPU threads for the nano model.
  • FAB-S takes 78 ms per person on the Apple GPU before its SMPL fit. As released, the fit crashes on both the Apple GPU and a CPU-only PyTorch build.
  • With a five-line patch, FAB's fit adds 85 ms on the Apple GPU and about 10 ms on CPU, so the fit belongs on the CPU.
  • FAB and InstantHMR disagree by about 30 mm on the same frames, about as much as each disagrees with its own smaller model.
  • Update, November 24: converted to native Core ML, InstantHMR medium's network runs in 1.8 ms on an iPhone 18 Pro's Neural Engine. The same file on the M3 Max's Neural Engine is just as fast and wrong by about 100 mm.

For anyone who was reading before November: the blog has moved from ambient wearables to the algorithms under them, meaning vision of bodies and hands, music and audio ML, and what they cost on consumer hardware. This is the first post on that footing.

Two designs, two weeks apart

InstantHMR (opens in a new tab) is the conservative one. A small network regresses the parameters of MHR (Meta's Momentum Human Rig, the body model behind SAM 3D Body), an optional kinematic fit re-reads one or two tighter crops, and the whole thing is exported as static ONNX graphs. The paper times it on a desktop GPU, an Intel CPU and Android phones, and says plainly that it did not evaluate Apple's Neural Engine.

FAB (opens in a new tab) turns the order around. Its head predicts 468 SMPL surface points, 70 keypoints and 14 joints as heatmap-plus-depth points, and only then recovers a parametric body: a learned one-pass fitter, two robust Gauss-Newton steps, and a closed-form foot refinement. The authors' summary of why:

Predicting dense points and fitting the body to them gives an estimator above 30 fps that is more accurate than SAM 3D Body on most benchmarks.

That 30 fps is one RTX 4070 Ti SUPER with a TensorRT body and the fit captured as a CUDA graph.

What I ran

Both repos, pinned (InstantHMR (opens in a new tab) at 6b187ea, FAB (opens in a new tab) at ec65caf), on an M3 Max laptop with 36GB. The input was the 324 frames of FAB's two demo clips, one person in each, with the same RF-DETR person boxes handed to both methods so they see identical crops. Times are medians per person and exclude the detector. There is no ground truth on these clips, so everything about accuracy below is disagreement between models, not error. Two clips and one machine; treat it as that.

InstantHMR: the Core ML path lost to the CPU

On four CPU threads InstantHMR nano takes 19 ms from crop to an 18,439-vertex mesh and medium takes 43 ms. With --device coreml as released, nano takes 33 ms. The accelerated path is slower than the CPU.

The cause is the default: a bare CoreMLExecutionProvider in ONNX Runtime uses the old NeuralNetwork model format. Asking for ML Program fails on the exported graphs because of their dynamic batch axis, and pinning that axis to 1 fixes it. With both changes medium drops from 34 to 18 ms, and medium with the two-crop fit drops from 132 to 25 ms. Restricting Core ML to CPU plus Neural Engine gave CPU-only speed, so on this machine the gain is the GPU.

The repo's default detector, RF-DETR medium, took 33 ms a frame on the same GPU. Once the mesh costs 18 ms, the detector is the larger half of the pipeline. The paper's own Android app runs its detector only once per second.

Why is FAB's fit slower on a GPU than on four CPU threads?

Because the fit is thousands of tiny operations, and off CUDA nothing batches them. FAB's own code comments count about 2,460 small kernels in the fit chain, which on CUDA are captured into one graph and replayed. PyTorch's MPS backend has no equivalent, so each small op pays its dispatch cost. A CPU pays none. I did not profile this per op, so this is the likely explanation, unmeasured.

Getting there took a patch. With SMPL installed and default settings, FABPredictor(device="mps") dies in a Kabsch solve that casts to float64, which MPS does not have. device="cpu", which the README says works, dies in the Gauss-Newton step:

RuntimeError: Cannot set preferred backend to cuSOLVER if PyTorch has not been compiled with cuSOLVER.

Five changed lines fix both: send the 3x3 solve to the host on MPS, and skip the cuSOLVER preference when the tensor is not on CUDA. After that, FAB-S goes from 78 ms without the fit to 162 ms with it on the Apple GPU: about 26 ms for the learned pass, 40 for the two Gauss-Newton steps, 19 for the foot refinement. On four CPU threads the network takes 190 ms and the whole fit adds 10. FAB-L is 185 ms before the fit and 267 after.

Per-person latency budgetFive horizontal bars of median milliseconds per person, each split into a network segment and a highlighted fit segment; two short InstantHMR bars above three longer FAB-S bars.050100150200median ms per person on an M3 Max, person detector not includedInstantHMR mediumInstantHMR medium + fitFAB-S, all on the Apple GPUFAB-S, GPU network + CPU fitFAB-S, all on 4 CPU threads18 ms25 ms, fit adds 6.5162 ms, fit adds 85110 ms, fit adds 32200 ms, fit adds 10
Median time per person on an M3 Max, split into network and fit; InstantHMR runs through the patched Core ML path, FAB-S through eager PyTorch, and the person detector is not included.

The obvious arrangement is the network on the GPU and the fit on the CPU. I shimmed FAB's three fit calls onto a CPU copy of the fitter and got 110 ms for FAB-S, with identical output. The CPU fit calls account for 15 ms of that; the rest of the overhead is still on the GPU side and I did not chase it.

What the fit buys, and what stays open

The fitted SMPL does not land on the points. Its 14 joints sit about 13 mm (FAB-S) and 10 mm (FAB-L) from the dense head's own joints after Procrustes alignment. The two Gauss-Newton steps move the joints by 5 mm and close 1 mm of that gap. One caveat I cannot separate out: FAB's setup script warned that the SMPL 1.1.0 neutral file the README tells you to download is not the file behind the paper's numbers.

On accuracy between the two families I have a non-answer worth stating. FAB-L and InstantHMR medium disagree by 30 mm over 21 body keypoints. FAB-S and FAB-L disagree by 25 mm; InstantHMR nano and medium by 30. The papers report 32.7 and 40.0 mm on 3DPW, under different protocols. A 7 mm benchmark gap between methods that sit 30 mm apart on these clips does not tell me which one is right on my data, and FAB's lead is distilled from a fine-tuned SAM 3D Body, so it inherits whatever that teacher gets wrong.

A dated call before the verdict: through June 30, 2027, no points-first body-mesh model publishes a measured end-to-end time under 33 ms per person on a phone NPU or on Apple silicon. Both patches are drafted for upstream and not yet submitted.

Update, November 24: what does InstantHMR cost on an iPhone 18 Pro?

About 2 ms for the network, on the Neural Engine, and the answers are right there. On the laptop's Neural Engine they are not.

I meant to run the same ONNX graphs on the phone through ONNX Runtime. This week its GitHub repositories return 404 and the official binary host serves a certificate for another name, so I converted the graphs instead: ONNX to PyTorch with onnx2torch, then to an fp16 Core ML ML Program with coremltools 9. That turned out to matter more than the phone did. ONNX Runtime's Core ML provider had been cutting the nano graph into 13 Core ML pieces with CPU nodes between them. As one Core ML model there are no seams.

Median ms for the network alone, on 41 real crops from the two clips, same Swift harness on both machines:

modelcompute unitsM3 MaxiPhone 18 Pro
nanoGPU2.81.9
nanoNeural Engine1.11.3
nanoCPU only4.22.3
mediumGPU4.33.7
mediumNeural Engine2.01.8
mediumCPU only9.95.8

For scale, the patched ONNX Runtime path earlier in this post spends 8.6 ms in the medium graph alone on the same laptop, and the paper reports 5.49 ms for medium on a Galaxy S23 NPU. The body-model graph that turns parameters into a mesh adds 2 to 3 ms on either device.

Speed is half of it. I pushed each run's parameters through the fp32 body model and compared 70 keypoints, centred, against the fp32 CPU reference. On the GPU the difference is under 1 mm on both machines. On the iPhone's Neural Engine it is about 2 mm on average, with a worst joint of 16 mm. On the M3 Max's Neural Engine (macOS 26.7) the same file is off by 100 mm on average, with single joints out by 30 cm. That is a different pose, produced without an error or a warning. I have not found which layer does it. Asking Core ML for all compute units avoids the problem on the laptop, where it does not pick the Neural Engine for this model, and on the phone it does pick it.

What did not make it to the phone: InstantHMR's fit graphs, which mix fp16 and fp32 in a way the converter rejects, and all of FAB. FAB's network will not export, because its preprocessing branches on tensor values, and its encoder alone fails inside coremltools. So the experiment I proposed at the end of this post is harder than I made it sound. These times are the network only, with no detector, crop, or mesh, from one phone and one run with the thermal state nominal throughout.

My verdict for anything that is not an RTX card: direct regression exported as a static graph is the design that ports. InstantHMR was a 14-line patch away from 18 ms. FAB's dense points are the more interesting output, and its network is where the remaining 78 ms lives, so the experiment I would run next is exporting FAB-S's network alone to Core ML and keeping the fit on two CPU threads. (I tried the export afterwards; see the update above.)

Comments