/ writing

Writing

69 technical notes across AI infrastructure, LLM algorithms, CS336, key concepts, and engineering reviews.

Kimi · zh

[Kimi-2] Kimi Linear: Rewriting Long-Context Attention with KDA

A systems-oriented derivation of Kimi Delta Attention, covering channel-wise forgetting, the specialized DPLR transition, chunkwise kernels, the 3:1 KDA/MLA hybrid, controlled evaluations, and the quality-throughput trade-off at 1M context.

Kimi · Kimi Linear · Linear Attention · Kimi Delta Attention · Gated DeltaNet

AI Infra · zh

[Infra-13] How vLLM Fixed Mamba Prefix Cache Poisoning

A deep dive into vLLM PR #51113: how MTP/EAGLE, concurrent chunked prefill, and prefix caching could advertise an incomplete Mamba recurrent state as a complete cache block, and how scheduler alignment restores correctness.

Infra · vLLM · Mamba · GDN · Prefix Caching

Kimi · zh

[Kimi-1] Kimi k1.5 Technical Report: Scaling Reinforcement Learning with 128K Long CoT

A systems-oriented reading of Kimi k1.5, covering verifiable RL prompts, Long-CoT SFT, online mirror-descent policy optimization, length penalties, partial rollouts, hybrid training and inference deployment, multimodal training, and long2short.

Kimi · Reinforcement Learning · Long CoT · Test-Time Compute · Multimodal LLM

DeepSeek · zh

[DeepSeek-6] DSpark: From Draft Models to Serving-Aware Speculative Decoding

A systems-oriented deep dive into DSpark, covering semi-autoregressive drafting, Markov/RNN sequential heads, confidence heads, STS calibration, hardware-aware prefix scheduling, training objectives, DeepSpec implementation, and DeepSeek-V4 deployment tradeoffs.

DeepSeek · DSpark · Speculative Decoding · LLM Inference · Serving System

Notes · zh

Notes: MLA, Linear Attention, and Long-Context Memory

A systems-oriented comparison of GQA, MLA, Linear Attention, and Sparse Attention, and why hybrid memory architectures are emerging as the practical direction.

LLM · Attention · MLA · Linear Attention · KV Cache

DeepSeek · zh

[DeepSeek-4] DeepEP: The Token Traffic System for MoE Expert Parallelism

A systems-oriented deep dive into DeepEP V2, covering MoE dispatch and combine semantics, rank-level deduplication, ElasticBuffer, EPHandle, direct and hybrid communication, FP8 transport, SM/QP modeling, and communication-compute overlap.

DeepSeek · DeepEP · Mixture of Experts · Expert Parallelism · NCCL

What Is Series · zh

What Is Beam Search?

A technical guide to Beam Search: sequence scoring, expansion and pruning, beam width, length normalization, stopping criteria, and inference costs.

LLM · Decoding · Inference · Beam Search · Sequence Generation

What Is Series · zh

What Is a Compiler Pass?

An engineering-oriented introduction to compiler passes: how they analyze and rewrite graphs and IR, and how fusion, lowering, pattern rewriting, and kernels fit together.

Compiler · Pass · IR · Graph Optimization · AI Infra

AI Infra · zh

[Infra-8] MTP: Multi-Token Prediction Modules

A serving-oriented guide to Multi-Token Prediction: its training objective, DeepSeek-V3 sequential MTP modules, speculative verification, KV cache commit, and scheduler integration.

Infra · LLM Serving · Speculative Decoding · MTP · KV Cache

MLC chentianqi · zh

[MLC-06] GPU Acceleration and Tensorization

Notes for lesson six: thread blocks, local/shared-memory tiling, hardware specialization, and tensorization for mapping tensor programs to GPUs.

MLC · GPU · CUDA · Tensorization · Shared Memory

MLC chentianqi · zh

[MLC-04] Automated Program Optimization and Meta-Schedule

Notes for lesson four: turning schedules into a search space, stochastic schedule transformations, candidate measurement, and the Meta-Schedule optimization loop.

MLC · Meta-Schedule · Auto Tuning · Search · TensorIR

AI Infra · zh

[Infra-6] xLLM: From Inference Engine to Cluster Serving

Where xLLM fits in LLM infrastructure: not a model, but an inference engine and clustered serving system for diverse AI accelerators, with Service-Engine decoupling, PD/EPD disaggregation, global KV cache, dynamic scheduling, and MoE optimizations.

Infra · xLLM · LLM Serving · Distributed Inference · KV Cache

MLC chentianqi · zh

[MLC-03] End-to-End Model Execution and Relax

Notes for lesson three: using Relax graphs, call_tir, dataflow blocks, and parameter binding to assemble TensorIR functions into an executable model.

MLC · Relax · IRModule · call_tir · Runtime

MLC chentianqi · zh

[MLC-02] Tensor Program Abstraction and TensorIR

Notes for lesson two: primitive tensor functions, loops, buffers, block axes, and why TensorIR schedules make tensor programs optimizable.

MLC · TensorIR · Schedule · Tiling · Tensor Program

AI Infra · zh

[Infra-5] K8s and Infra

A practical walkthrough of where Kubernetes fits in AI infrastructure: deployment, scheduling, scaling, recovery, and its relationship with Docker, Ray, Slurm, and LLM serving engines.

Infra · Kubernetes · K8s · LLM Serving · GPU

MLC chentianqi · zh

[MLC-01] Machine Learning Compilation Overview

Notes for lesson one of Machine Learning Compilation: development and deployment forms, tensor functions, and the abstraction-implementation boundary.

MLC · Compiler · Deployment · Tensor Function · TVM

What Is Series · zh

What Is an N-Gram Model?

A practical explanation of N-Gram language models: chain rule, Markov assumption, count-based estimation, sparsity, smoothing, backoff, interpolation, and how they differ from Transformers.

NLP · Language Model · N-Gram · Transformer · Data

Notes · zh

Talking About Reasoning

A narrative note on what reasoning changes and does not change, from training and reasoning tokens to vLLM serving, PD disaggregation, and production benchmarking.

LLM · Reasoning · Inference · vLLM · Serving

What Is Series · zh

What Are Checkpoints?

A practical explanation of checkpoints in LLMs: what they store, how they enable resume training, how they relate to model weights and .safetensors, and how serving systems load them.

LLM · Checkpoint · Safetensors · Training · Inference

AI Infra · zh

[Infra-4] Prefill-Decode Disaggregation

A practical walkthrough of prefill-decode disaggregation: why prefill and decode conflict, what is actually disaggregated, how it affects TTFT and TPOT, and why KV cache transfer becomes the new systems bottleneck.

Infra · Distributed Inference · vLLM · KV Cache · LLM

What Is Series · zh

What Is CUDA Graph?

A practical explanation of CUDA Graph: how it captures stable CUDA workloads for replay, why it reduces launch overhead, and how it is used in PyTorch and LLM serving.

CUDA · GPU · PyTorch · LLM · Inference

What Is Series · zh

What Is Linear Attention?

A practical explanation of Linear Attention: how kernel feature maps and recurrent states reduce long-context cost, and why Gamma, Delta, Gate, and Conv variants matter.

LLM · Attention · Linear Attention · Inference · Long Context

What Is Series · bilingual

What Is muP?

An intuitive guide to Maximal Update Parametrization, covering its motivation, relation to NTK and standard parametrization, Transformer-specific changes, and hyperparameter transfer.

Deep Learning · LLM · Training · muP · Scaling

AI Infra · zh

[Infra-3] Distributed Training and Distributed Inference

A practical comparison of distributed training and distributed inference across goals, dataflow, memory, communication, performance metrics, scheduling, and vLLM deployment.

Infra · Distributed Training · Distributed Inference · vLLM · LLM

What Is Series · zh

What Is a Skill?

A practical explanation of skills in AI agents: reusable workflow packages that combine instructions, metadata, optional scripts, and resources.

AI Agent · Codex · Skill · Workflow · LLM

AI Infra · zh

[Infra-2] NCCL

A first-person walkthrough of NCCL: its role in distributed GPU systems, common collectives, topology-aware communication, multi-node paths, and practical debugging.

Infra · NCCL · Distributed Systems · vLLM · GPU

CS336 · zh

[CS336-16] RLVR

Notes for Stanford CS336 Spring 2025 lecture 16: RLVR, GRPO.

CS336 · RLVR · GRPO

CS336 · zh

[CS336-15] RLHF and Alignment

Notes for Stanford CS336 Spring 2025 lecture 15: Alignment, RLHF, SFT.

CS336 · Alignment · RLHF · SFT

CS336 · zh

[CS336-13] Data Overview

Notes for Stanford CS336 Spring 2025 lecture 13: Data, Pretraining.

CS336 · Data · Pretraining

CS336 · zh

[CS336-12] Evaluation

Notes for Stanford CS336 Spring 2025 lecture 12: Evaluation, Benchmarks.

CS336 · Evaluation · Benchmarks

CS336 · zh

[CS336-11] Scaling Details

Notes for Stanford CS336 Spring 2025 lecture 11: Scaling, muP.

CS336 · Scaling · muP

CS336 · zh

[CS336-10] Inference

Notes for Stanford CS336 Spring 2025 lecture 10: Inference, KV Cache.

CS336 · Inference · KV Cache

CS336 · zh

[CS336-09] Scaling Laws Basics

Notes for Stanford CS336 Spring 2025 lecture 9: Scaling Laws, Chinchilla.

CS336 · Scaling Laws · Chinchilla

CS336 · zh

[CS336-07] Parallelism Basics

Notes for Stanford CS336 Spring 2025 lecture 7: Parallelism, ZeRO.

CS336 · Parallelism · ZeRO

CS336 · zh

[CS336-05] GPUs

Notes for Stanford CS336 Spring 2025 lecture 5: GPU, CUDA, FlashAttention.

CS336 · GPU · CUDA · FlashAttention