From training to inferenceIntroduction to vLLMPrerequisitesInstallationDocker SetupInstall and run from package manager (uv, conda, pip)Compile, install, and run from local sourceOffline inferenceOnline inferenceKV cacheDecoder-Only transformer architectureText generation process: prefill and decodeThe decode phase and its inefficienciesKV cache solutionPagedAttention: solving KV cache fragmentationThe KV cache fragmentation problemHow PagedAttention worksEliminating padding FLOPsConnection to distributed inferenceMotivation: the "out of memory" problemOverview of the vLLM architectureOverview of parallelism strategies in vLLMTensor Parallelism (TP)The linear algebra foundationsBenefits of Tensor ParallelismWhen to use Tensor ParallelismData Parallelism (DP) for throughput scalingCombining Data Parallelism with other strategiesDeployment modesBenefits and Trade-OffsPipeline Parallelism (PP)The pipeline bubble problemChunked prefill for smoother pipelinesExpert Parallelism (EP): A modifier flag for MoE modelsUnderstanding MoE architectureDecoder layer structureExpert structureRouting mechanismHow Expert Parallelism modifies behaviorCombining parallelism strategiesTP + PP: the standard Multi-Node configurationExpert Parallelism combinationsTP + DP: scaling both waysThe EP activation constraintHands-On examplesBasic vLLM setup with Tensor ParallelismMulti-Node with TP and PPCustom chunked prefill configurationProfiling with Nsight SystemsBest practicesSummaryCode summaryUseful linksReferencesExercisesImplement KV cache managementImplement continuous batchingBenchmark vLLM throughputImplement speculative decodingDeploy vLLM with OpenAI-Compatible APIExpected learning outcomesSubscribe to Deep Engineering