Archive

1422 posts · Page 14 of 119. ← Blog

Pratik Dhanave · ·7 min read

Pricing and Valuation Engines — Building the Core

At the heart of most financial systems is an engine that answers one question: what is this worth? Pricing and valuation engines turn the mathematics of the first-principles Financial Engineering series into production software — and AI is reshaping them, both by accelerating expensive computations and by valuing the illiquid instruments that have no market price. This post is about building the valuation core and where AI fits into it.

At the heart of most financial systems is an engine answering 'what is this worth?'. Building valuation engines in production, and where AI fits: accelerating expensive computations (ML surrogates for Monte Carlo) and extending valuation into illiquid, document-driven instruments. Engineered to be validated, auditable, and reproducible. (Educational, not financial advice.)

Pratik Dhanave · ·4 min read

The Forward Deployment Stack

The forward deployed engineer gets all the attention, but forward deployment is bigger than one role. It's a go-to-market operating model with three layers — build, scale, run — and seeing the whole stack is how AI companies turn embedded engineering from a heroic cost center into a repeatable engine.

The forward deployed engineer gets all the attention, but forward deployment is bigger than one role — it's a go-to-market operating model with three layers: build (engineer), scale (architect), run (leader). Seeing the whole stack is how AI companies turn embedded engineering from a heroic cost center into a repeatable engine.

Pratik Dhanave · ·5 min read

Memory Management for LLM Inference — The KV Cache Problem

The single largest consumer of GPU memory during inference often isn't the model — it's the KV cache, the growing store of attention state that lets a model generate text without recomputing the past. Managing it well is the difference between serving a handful of users and serving thousands on the same hardware. This post explains what the KV cache is, why it's such a brutal memory problem, and how PagedAttention borrowed a 1960s operating-systems idea to solve it.

The KV cache often exceeds the model weights in HBM, and naive contiguous allocation wrecks concurrency with fragmentation. PagedAttention applies operating-system paging to fix it — a core inference bottleneck solved by borrowing a classic systems idea.

Pratik Dhanave · ·7 min read

The Data Foundation — Where Financial AI Lives or Dies

Every AI financial system is built on data, and in finance the data is uniquely treacherous: expensive, fragmented, revised after the fact, survivor-biased, and riddled with subtle ways to accidentally see the future. Getting the data foundation right matters more than any model — a brilliant model on leaky or biased data is a confident path to losing money. This post is about the financial data landscape and the traps that make it the hardest, most decisive part of the work.

Every financial AI system lives or dies on its data, and financial data is uniquely treacherous: expensive, fragmented, revised, survivor-biased, and riddled with ways to accidentally see the future. The landscape (market, document, proprietary data) and the traps — lookahead, survivorship, point-in-time correctness — that make it the most decisive part. (Educational, not financial advice.)

Pratik Dhanave · ·5 min read

The Attention Bottleneck — and How FlashAttention Fixed It

Attention is the operation that makes transformers powerful, and for years it was also their worst performance bottleneck — not because it does too much math, but because it moved too much data. FlashAttention is the single most important GPU optimization of the LLM era, and it's a perfect case study in everything this series has built: it's memory-bound, the roofline says so, and the fix is to raise arithmetic intensity by never writing the big intermediate to HBM. Understanding it is understanding how real kernel optimization works.

Naive attention materializes an N×N matrix in HBM — memory-bound and quadratic. FlashAttention fixes it with pure roofline reasoning: tile into shared memory, use an online softmax, fuse the kernel, never touch HBM. The archetype of all inference optimization.

Pratik Dhanave · ·6 min read

What AI Financial Engineering Is — Where Quant Finance Meets AI

Financial engineering has always been computational, but a new layer is reshaping it: artificial intelligence applied not just to predict prices but to read documents, structure judgment, monitor risk, and preserve institutional decision-making. AI financial engineering is the discipline of building these systems end to end — and doing it in an industry where being wrong costs real money and being unexplainable is often illegal. This series builds that discipline from first principles to production.

Financial engineering has always been computational; AI now extends it into reading documents, structuring judgment, and monitoring risk. What AI financial engineering is — the synthesis of model-driven quant and data-driven AI — and why finance (real money, mandatory explainability, auditability, adversarial data, human judgment) makes it uniquely hard. (Educational, not financial advice.)

Pratik Dhanave · ·5 min read

Numeric Precision — Why Lower Precision Makes Inference Faster

The fastest way to speed up LLM inference is often not a better algorithm but fewer bits per number. Precision — how many bits represent each weight and activation — is a direct lever on both of the limits this series has built up: it halves or quarters the data you move (bandwidth, post 2) and unlocks the GPU's fastest arithmetic units (compute, post 3). Understanding floating-point formats is understanding why fp16, bf16, and int8 are everywhere in modern inference.

FP32, FP16, BF16, and INT8/INT4 — how a float splits bits between range and precision, why bf16 won, and why fewer bits is a double win: less data to stream from HBM and faster tensor-core math. Quantization and why LLMs tolerate it.

Pratik Dhanave · ·7 min read

The Skill Reference — Structure, Templates, and Putting It Together

This closing post makes everything concrete: the anatomy of a skill definition, the templates that get you started fast, and the synthesis of the series into a practical approach you can apply today. It turns the principles — scope, context discipline, specificity, reliability, operation — into a reference you can build from.

The concrete reference: the anatomy of a skill definition (the SKILL.md pattern — metadata/trigger, instructions, knowledge, resources), starter templates (general, domain, workflow, integration), and the series' synthesis — make agents reliably useful by building and tending a library of captured expertise.

Pratik Dhanave · ·5 min read

The CUDA Execution Model — Threads, Warps, and Occupancy

To make a GPU fast you have to express your problem the way the hardware wants to run it: as thousands of near-identical threads marching in lockstep. CUDA is the programming model that exposes this, and its abstractions — threads, warps, blocks, grids — map directly onto the SMs and cores from post 1. You don't need to write kernels to be an inference engineer, but you do need this model to understand why some operations fly and others crawl.

Threads, warps, blocks, and grids; SIMT and branch divergence; and the cleverest trick — hiding slow memory by oversubscribing warps (occupancy). Why a GPU can be underutilized without being either compute- or memory-bound.

Pratik Dhanave · ·6 min read

Skills in the Wild — What Works in Real Use

The gap between a skill that works in a demo and one that works reliably in daily use is where most of the real lessons live. Skills in the wild face messy inputs, edge cases, drift, and the challenge of being maintained and shared across a team over time. This post is about what actually works when skills meet reality — the patterns that hold up, the failure modes that recur, and the operational discipline that keeps a skill library useful.

The gap between a demo skill and one that works in daily use is where the real lessons live. What makes skills succeed in the wild (the fundamentals), the failure modes that recur (drift, overlap, trigger misfires, bloat, over-trust), and operating the library as a maintained, curated, shared system.

Pratik Dhanave · ·7 min read

From Bespoke AI to Product

Every AI forward deployed engineer builds one-offs — a bespoke deployment for one customer's data, workflow, and trust. The ones who create lasting value turn those one-offs into product: the patterns that repeat become a platform, the platform makes the next deployment faster, and the field learnings flow back to shape what gets built. This closing post is about the flywheel that turns bespoke AI work into a compounding asset, and the career arc of the engineer who runs it.

Every AI FDE builds one-offs — a bespoke deployment for one customer's data, workflow, and trust. The ones who create lasting value turn those one-offs into product: the patterns that repeat become a platform, the platform makes the next deployment faster, and field learnings flow back to shape what gets built. The flywheel that turns bespoke AI work into a compounding asset — and the AI FDE career arc.

Pratik Dhanave · ·5 min read

The Roofline Model — Are You Compute-Bound or Memory-Bound?

Posts 1 and 2 kept drawing a line between two worlds: workloads limited by how fast the GPU can compute, and workloads limited by how fast it can move data. The roofline model is the single tool that tells you which world you're in for any given operation — and therefore which optimizations will help and which are a waste of time. It is the most useful mental model in performance engineering, and it fits on one chart.

The roofline model answers the one question that governs every optimization — compute-bound or memory-bound? — from arithmetic intensity (FLOPs per byte). Why LLM prefill is compute-bound and decode is memory-bound, and why batching is the master throughput lever.