Field Report 02
Agent-generated GPU kernels on a real hot path — Makora × BearingBrain, verified on independent hardware
Status: Complete · Date: 2026-08-07 · Cost: $0
The short version
BearingBrain's selection API runs an ISO 281 bearing rating-life (L10) calculation per candidate on every query. We fed that calculation to Makora's agentic GPU-kernel generator. The winning fused CUDA kernel runs the 100,000-candidate sweep in 0.013 ms on an H100— about 210× faster than the eager reference and 21.6× faster than torch.compile.
We then independently verified the generated kernel on an RTX A3000: 34.8× faster than eager at 100k candidates, 67× at 1M, with a max relative error of 2.8×10⁻⁷ against the reference.
Total cost: $0.00 — Makora's generate tier plus hardware we already own.
The hot path
BearingBrain answers queries like "which bearings survive 12,000 hours at 12 kN radial / 3 kN axial, 1,800 RPM, 95 °C, grease?" For each query it:
- SQL-filters the catalog (bore/OD/width constraints) → up to 100 candidates
- For every candidate, runs calculateBearing(): load-factor lookup branched by bearing type (deep-groove X/Y table keyed on f0·Fa/C0, angular-contact by contact angle, self-aligning, spherical, cylindrical, tapered), equivalent dynamic load P = X·Fr + Y·Fa, L10 life = (C/P)^p (p=3 balls, 10/3 rollers), static/dynamic safety factors, speed utilization, temperature derating
- Returns suitability-ranked results
The workload is embarrassingly parallel — thousands of independent scalar calculations — but the branchy load-factor tables make it a poor fit for naive GPU vectorization. That is exactly the kind of code an agentic kernel generator is designed to fuse.
The reference
We ported the production TypeScript into a batched PyTorch reference: 100,000 synthetic catalog candidates (6 bearing types, ISO 281 tables matching production), scalar application params, and the full 7-tuple output: P, L10 revolutions, L10 hours, static safety, dynamic safety, speed utilization, suitability. Fidelity was proven by comparing the port against the actual production TypeScript across 7 scenarios — identical to the decimal.
Makora generate
Makora's agentic loop ran 4 attempts, generating 44 valid kernels / 40 failed, exploring CUDA fusion strategies for the branchy table lookups. Best results (Makora's own H100 evaluation):
| Kernel | Time (H100) | vs torch.compile |
|---|---|---|
| #10 (03179124) | 0.013 ms | 21.62× |
| #67 (ebfe2288) | 0.013 ms | 17.35× |
| #17 (8f29b5c2) | 0.014 ms | 14.35× |
| #29 (74292fbb) | 0.071 ms | 2.91× |
| #6 (80aa9305) | 0.081 ms | 3.23× |
The winning kernels fuse the branchy X/Y/e table lookup and the main L10 math into a single CUDA kernel, replacing multiple eager torch passes. The winner is plain CUDA — no H100-specific features — so it runs on any modern NVIDIA GPU.
Independent verification: RTX A3000
We ran the generated kernel on our own RTX A3000 (Ampere, 6 GB) with torch 2.11+cu128 and the CUDA toolkit, comparing against the batched reference on-device:
| Metric | N=100k | N=1M |
|---|---|---|
| Reference eager | 1.608 ms (62.2 M/s) | 3.284 ms (304.5 M/s) |
| Kernel #10 | 0.0463 ms (2.16 G/s) | 0.0490 ms (20.4 G/s) |
| Speedup | 34.76× | 67.09× |
| Correctness | PASS (rel err 2.8e-7) | PASS |
Two more kernels cross-checked: #17 at 0.0461 ms (55.2× vs eager) and #67 at 0.0519 ms (82.1× vs eager), both PASS. Reference eager timing is noisy across runs (1.6–4.3 ms; GPU clocks/thermal state), so speedup-vs-eager is approximate; kernel absolute latency 0.046–0.052 ms is the stable, exact number. The kernel is memory-bandwidth-bound at scale — 20 G candidates/s at 1M is near the A3000's practical bandwidth ceiling — and latency stays ~50 µs regardless of catalog size.
100k-candidate sweep, RTX A3000
1.608 ms→0.0463 ms34.7× faster
What this means for a production query path
- A 100-candidate sweep ≈ 50 µs (vs ~2.5 ms eager on the same GPU)
- The whole catalog (100k+ bearings) can be pre-scored in ~50 µs — instant global suitability ranking, sensitivity analysis, or batch re-rating of the full inventory
- At 1M candidates the kernel sustains 20 G candidates/s — a full multi-year life-cycle re-rating is a sub-millisecond event
Notes and limitations
- Makora's H100 numbers are their own evaluation harness; we verified the kernel on the A3000 (a different GPU class) — same qualitative story, different absolute numbers (34.8× vs 210×; the H100's bandwidth amplifies a memory-bound kernel's win).
- The reference is a batched port of production math — production is scalar JS per candidate; the batch formulation matches production semantics exactly and is the fair GPU comparison.
- 40 of 84 generated kernels failed validation — kernel generation is still a search, not a guarantee. Makora's loop handled it across 4 attempts.
- We did not deploy the kernel into BearingBrain production. This report documents the pattern and the measurements.
Cost
- Makora generate (H100 eval, 4 attempts, 44 kernels): $0.00
- Dell RTX A3000 (owned; torch 2.11 + CUDA toolkit ~1 GB disk): $0.00
- Prime pods/sandboxes: not used
- TOTAL: $0.00
This is the work we do
The same standard, applied to your workflow
Field reports are real builds we did on our own systems. Client work follows the same pattern: a defined before/after, reproducible measurements, and an honest account of constraints. If you have a repetitive, measurable process that would benefit from an evaluation gate or a faster hot path, we can scope it.