文中所有可点击的链接都会跳转到对应面试题的详解。
建议边读边点,像翻地图一样逛完 305 个知识点。
单页浏览:本地 study.html;在线请用 Pages 链接(勿用 Raw)。改
.md后运行python build_study_html.py再提交study.html。
你收到 HR 的消息:面试范围是 AI 基础设施 / 机器学习系统,从框架底层到集群调度都可能问。
「Infra」俩字听起来很广:从你写的 model(x) 背后怎么求导、怎么分到多卡,到推理服务怎么扛 10 万 QPS、K8s 怎么调度 GPU,中间每一环都可能考。
你打开那份 305 题 清单——从 PyTorch Autograd 到 etcd 在 K8s 中的作用,从 DDP 与 FSDP 到 vLLM PagedAttention——密密麻麻,像一张从「单机训练」画到「多租户集群」的长卷。
与其对着题号硬啃,不如换一种玩法:按「一天搞懂 AI Infra」的主线,从框架底层 → 编译器与算子 → 分布式训练 → 显存与通信 → 推理引擎与量化 → 服务化与平台设计 → 语言与网络存储,把 305 题串成一条线。每条线底下都挂着一串可点的链接。
两样配合用,效果更好。祝面试顺利。
一天从「你写的代码到底是怎么跑的」开始。PyTorch 底层决定了训练脚本里的每一行 tensor、每一个 backward 在 C++/CUDA 里长什么样。
第 1 题:Autograd 与 torch.autograd.Function、第 2 题:Module 的 call 与 forward、第 3 题:Dispatch、ATen、c10、torch.library、第 4 题:自定义 CUDA 算子在 PyTorch 中调用、第 5 题:内存池与显存碎片、第 6 题:torch.jit.trace 与 script、第 7 题:DataLoader num_workers 与 too many open files、第 8 题:DDP 与 FSDP 区别、第 9 题:torch.compile 与 TorchDynamo/AOTAutograd/Inductor、第 10 题:CUDA kernel 调试与 CUDA_LAUNCH_BLOCKING、第 11 题:hook、forward_pre_hook、backward_hook、第 12 题:QAT 与 torch.ao.quantization、第 13 题:checkpoint 梯度检查点、第 14 题:AMP 与 GradScaler、第 15 题:torch.profiler 与 nvprof。
除了 PyTorch,TF 栈在工业界仍大量存在。XLA 把计算图编译成更高效的 kernel,tf.function 和 PyTorch 的 JIT 设计理念不同;SavedModel、TF Serving 的 batching 也是常考点。
第 16 题:XLA 优化场景与 jit_compile、第 17 题:tf.function 与 torch.jit 差异、第 18 题:XLA HLO IR 与编译日志、第 19 题:SavedModel 与 TorchScript、第 20 题:TF Serving batching。
从「用框架」到「写 kernel」:CUDA / Triton / CUTLASS、memory coalescing、bank conflict、occupancy、warp divergence、Nsight、以及 vLLM 的 PagedAttention 如何应对动态 shape。
第 21 题:CUDA vector add 绑定到 Python、第 22 题:Triton 与 CUDA 区别、第 23 题:融合算子 layernorm+residual+activation、第 24 题:CUTLASS 何时用、第 25 题:memory coalescing、bank conflict、occupancy、第 26 题:Nsight Compute 与 metrics、第 27 题:register 与 occupancy 平衡、第 28 题:warp divergence、第 29 题:动态 shape 与 PagedAttention、第 30 题:算子融合收益评估。
TVM、MLIR、TorchInductor、ONNX、TensorRT:loop tiling、unrolling、vectorization、PTQ/QAT 在编译器中的处理、稀疏与 pass manager、control flow 的 tracing 与 symbolic execution。
第 31 题:TVM Ansor 与 MetaSchedule、第 32 题:MLIR dialect、operation、pass、第 33 题:TorchInductor 到 Triton、第 34 题:ONNX Runtime 图优化、第 35 题:TensorRT plugin 与 dynamic shape、第 36 题:loop tiling、unrolling、vectorization、第 37 题:PTQ 与 QAT 在编译器、第 38 题:稀疏与 2:4 structured sparsity、第 39 题:pass manager top-down vs bottom-up、第 40 题:新硬件后端编译器支持、第 41 题:TVM vs MLIR vs TorchDynamo、第 42 题:AOT vs JIT、第 43 题:编译时间与缓存、第 44 题:operator decomposing 与 fusion 边界、第 45 题:control flow tracing vs symbolic。
多卡同模型:DDP 的 gradient bucketing、find_unused_parameters;FSDP 的 sharding、auto_wrap_policy;ZeRO-1/2/3;梯度累积、SyncBatchNorm、NCCL 排查、torchrun 与 mp.spawn、梯度压缩。
第 46 题:DDP gradient bucketing、第 47 题:find_unused_parameters、第 48 题:FSDP sharding strategy、第 49 题:FSDP auto_wrap_policy、第 50 题:ZeRO-1/2/3、第 51 题:loss scaling 分布式、第 52 题:梯度累积在 DDP 中、第 53 题:分布式 sampler、第 54 题:SyncBatchNorm、第 55 题:分布式 hang 与 NCCL_DEBUG、第 56 题:torchrun 与 mp.spawn、第 57 题:NCCL_SOCKET_IFNAME、NCCL_IB_DISABLE、第 58 题:梯度压缩 fp16/bf16/1bit Adam、第 59 题:异步训练 Hogwild、第 60 题:自定义分布式优化器。
单卡放不下就切模型:TP 的 fused attention、Megatron column/row parallel;PP 的 bubble、GPipe/PipeDream、1F1B;all-gather、reduce-scatter、micro-batch、3D 并行、序列并行、MoE Expert Parallelism、Zero Bubble、通信 profile。
第 61 题:TP fused attention、第 62 题:Megatron column/row parallel、第 63 题:PP bubble GPipe vs PipeDream、第 64 题:interleaved pipeline 1F1B、第 65 题:PP 中 activation checkpointing、第 66 题:TP/PP/DP 平衡 175B、第 67 题:torch.distributed.pipeline.sync.Pipe、第 68 题:all-gather、reduce-scatter、第 69 题:micro-batch 与吞吐、第 70 题:PP 负载均衡与 recompute、第 71 题:3D 并行通信复杂度、第 72 题:Sequence Parallelism、第 73 题:Expert Parallelism MoE all-to-all、第 74 题:Zero Bubble 流水线、第 75 题:分布式通信 profile。
ZeRO-Offload、DeepSpeed-Infinity、checkpoint、empty_cache、显存估算公式、activation compression、CPU-GPU 流水线重叠、多节点显存策略、ROI 评估。
第 76 题:ZeRO-Offload 到 CPU、第 77 题:DeepSpeed-Infinity NVMe、第 78 题:checkpoint_sequential 与 checkpoint、第 79 题:显存碎片分布式、第 80 题:empty_cache 副作用、第 81 题:大模型显存估算、第 82 题:checkpoint 与 activation compression、第 83 题:CPU offload 与计算重叠、第 84 题:多节点显存策略、第 85 题:显存优化 ROI。
NCCL Tree/Ring、all-reduce 通信量、NVLink/IB/TCP、NCCL_TOPO_FILE、通信计算重叠、nccl/gloo/mpi、RDMA RoCE/IB、iftop/nicstat、自定义 reduce_op、异构网络。
第 86 题:NCCL Tree 与 Ring、第 87 题:all-reduce 通信量、第 88 题:NVLink、InfiniBand、TCP、第 89 题:NCCL_TOPO_FILE、第 90 题:通信计算重叠 double buffering、第 91 题:backend nccl/gloo/mpi、第 92 题:RDMA RoCE v1/v2/IB、第 93 题:网络拥塞诊断 iftop nicstat、第 94 题:自定义通信算子 reduce_op、第 95 题:异构网络通信。
TensorRT builder/runtime、dynamic shape、plugin;ONNX Runtime EP;vLLM PagedAttention、continuous batching、prefix caching;TensorRT-LLM、FasterTransformer、TGI、llama.cpp 量化、移动端 MNN/TNN、warmup、多 stream、padding/packing、P50/P90/P99、auto-scaling、MPS、精度 debug。
第 96 题:TensorRT builder 与 runtime、第 97 题:TensorRT dynamic shape、第 98 题:IPluginV2DynamicExt 与 IPluginV2IOExt、第 99 题:ONNX Runtime execution provider、第 100 题:torch.compile 推理模式、第 101 题:vLLM PagedAttention、第 102 题:vLLM continuous batching、第 103 题:vLLM prefix caching、第 104 题:TensorRT-LLM in-flight batching、第 105 题:FasterTransformer decoder、第 106 题:TGI 架构、第 107 题:llama.cpp 量化 Q4_0 Q5_K_M、第 108 题:移动端 MNN TNN Paddle Lite、第 109 题:warmup 策略、第 110 题:多 stream 推理、第 111 题:padding 与 packing、第 112 题:延迟 P50 P90 P99、第 113 题:auto-scaling 策略、第 114 题:多模型混部 MPS、第 115 题:推理 debug 精度。
INT8 symmetric/asymmetric、per-tensor/per-channel;SmoothQuant、AWQ、GPTQ、OBQ;GGUF、FP8、H100 Transformer Engine;校准、sensitivity、k-means、BNN、知识蒸馏、剪枝、动态量化、算子融合、混合精度推理。
第 116 题:INT8 symmetric/asymmetric、第 117 题:SmoothQuant、第 118 题:AWQ、第 119 题:GPTQ 与 OBQ、第 120 题:GGUF Q4_K_M、第 121 题:FP8 与 H100、第 122 题:校准数据集、第 123 题:精度损失 layer-wise、第 124 题:k-means 与非均匀量化、第 125 题:二值化网络 BNN、第 126 题:知识蒸馏 MiniLLM DistilBERT、第 127 题:结构化与非结构化剪枝、第 128 题:动态量化与静态量化、第 129 题:量化算子融合、第 130 题:混合精度推理策略。
Triton model ensemble、dynamic batching;A/B testing、K8s GPU Operator、MIG;priority scheduling、preemption、health check、GPU 内存泄漏、hot reload、gRPC vs REST、timeout、多租户 quota、cost optimization、Edge deployment。
第 131 题:Triton model ensemble、第 132 题:Triton dynamic batching、第 133 题:A/B testing 模型版本、第 134 题:K8s GPU Operator、第 135 题:MIG 配置、第 136 题:priority scheduling、第 137 题:长文本 preemption KV swap、第 138 题:health check graceful degradation、第 139 题:GPU memory 泄漏监控、第 140 题:hot reload 零停机、第 141 题:gRPC vs REST、第 142 题:timeout 部分结果、第 143 题:多租户 quota limit request、第 144 题:cost optimization Spot、第 145 题:Edge 模型加密与兼容。
Megatron、DeepSpeed ZeRO-Infinity/Offload、Colossal-AI Gemini/PatrickStar、FairScale FSDP、Accelerate、limit_all_gathers;checkpoint 格式与 sharded 合并、resume 一致性、data pipeline WebDataset/tfrecord、多模态与 RLHF、MoE all-to-all、长上下文 Ring Attention、elastic training、experiment tracking。
第 146 题:Megatron 与 megatron/core、第 147 题:ZeRO-Infinity 与 ZeRO-Offload 入口、第 148 题:Colossal-AI Gemini PatrickStar、第 149 题:FairScale FSDP、第 150 题:Accelerate 分布式、第 151 题:limit_all_gathers、第 152 题:checkpoint 格式与 sharded 合并、第 153 题:resume consistency、第 154 题:data pipeline WebDataset tfrecord、第 155 题:多模态训练 infra、第 156 题:RLHF PPO 分布式、第 157 题:MoE Tutel FasterMoE、第 158 题:长上下文 Ring Attention、第 159 题:fault tolerance elastic、第 160 题:W&B MLflow。
safetensors vs pytorch.bin、Lustre/GPFS/Alluxio、caching burst buffer、memory mapping lazy loading、异步 checkpoint、nvidia-smi dmon、DALI、sharding、S3/s3fs、parquet/arrow。
第 161 题:safetensors vs pytorch.bin、第 162 题:Lustre GPFS Alluxio、第 163 题:caching SSD burst buffer、第 164 题:权重 memory mapping lazy load、第 165 题:多节点 checkpoint 同步、第 166 题:数据加载 bottleneck dmon、第 167 题:DALI 使用场景、第 168 题:sharding 按文件 vs 按样本、第 169 题:S3 OSS s3fs、第 170 题:metadata parquet arrow。
Slurm sbatch gres、Volcano、gang scheduling、PyTorchJob、resource quota、topology awareness、preemption checkpoint resume、Prometheus Grafana、federated learning、cost accounting、heterogeneous GPU。
第 171 题:Slurm sbatch gres、第 172 题:Volcano AI 场景、第 173 题:gang scheduling PyTorchJob、第 174 题:resource quota priority class、第 175 题:GPU topology NVLink、第 176 题:preemption checkpoint resume、第 177 题:Prometheus Grafana utilization、第 178 题:多集群 federated learning、第 179 题:cost accounting GPU 小时、第 180 题:heterogeneous A100 H100 4090。
nvidia-smi dmon/pmon、Nsight Systems timeline、Nsight Compute roofline、PyTorch Profiler memory、record_shapes profile_memory、Chrome Trace、perf eBPF、iperf qperf、fio iostat、dashboard、scaling efficiency、通信 breakdown、aten dispatch、cProfile py-spy、性能回归。
第 181 题:nvidia-smi dmon pmon、第 182 题:Nsight Systems timeline gap、第 183 题:Nsight Compute roofline、第 184 题:PyTorch Profiler memory、第 185 题:record_shapes profile_memory、第 186 题:Chrome Trace 解读、第 187 题:perf eBPF CPU、第 188 题:iperf qperf 网络、第 189 题:fio iostat 存储、第 190 题:端到端监控 dashboard、第 191 题:scaling efficiency、第 192 题:通信 breakdown、第 193 题:aten 算子耗时、第 194 题:cProfile py-spy、第 195 题:性能回归检测。
FlashAttention IO-aware、FlashAttention-2、xFormers、cuDNN fused attention、融合边界、arithmetic intensity、kernel fusion 手动 vs 编译、CUDA Graph、dynamic shape torch.compile、cudnn.benchmark、pin_memory non_blocking、num_workers、混合精度数值稳定性、effective batch size、LR scaling、LARS LAMB、communication hiding、pipeline bubble 数学、稀疏 attention。
第 196 题:FlashAttention IO-aware、第 197 题:FlashAttention-2 改进、第 198 题:xFormers memory_efficient_attention、第 199 题:cuDNN fused attention、第 200 题:融合边界 register pressure、第 201 题:带宽 bound vs 计算 bound、第 202 题:kernel fusion 手动 vs 编译、第 203 题:CUDA Graph make_graphed_callables、第 204 题:dynamic shape torch.compile、第 205 题:cudnn.benchmark、第 206 题:pin_memory non_blocking、第 207 题:num_workers 调优、第 208 题:DALI GPU decode augment、第 209 题:混合精度数值稳定性、第 210 题:gradient accumulation effective batch、第 211 题:大 batch LR scaling、第 212 题:LARS LAMB 大 batch、第 213 题:communication hiding、第 214 题:pipeline bubble 数学、第 215 题:稀疏 attention Sparse Longformer。
1000 卡平台组件、job scheduler FIFO/priority/fair、Ceph/JuiceFS/GPFS、镜像 layer registry、InfiniBand RoCE fat-tree、heartbeat watchdog、global shuffle、模型仓库版本血缘、HPO Optuna Ray Tune、multi-tenancy namespace cgroup、defragmentation、dry-run profiling、量化剪枝流水线、cost model、异构 CPU/GPU/TPU、SLA、联邦学习、disaster recovery、CI/CD、observability。
第 216 题:1000 卡平台组件、第 217 题:job scheduler 设计、第 218 题:Ceph JuiceFS GPFS、第 219 题:镜像 layer registry、第 220 题:网络 InfiniBand RoCE、第 221 题:故障检测恢复、第 222 题:global shuffle、第 223 题:模型仓库版本血缘、第 224 题:HPO Optuna Ray Tune、第 225 题:multi-tenancy 隔离、第 226 题:defragmentation、第 227 题:dry-run profiling、第 228 题:量化剪枝流水线、第 229 题:cost model、第 230 题:异构 CPU GPU TPU、第 231 题:SLA job completion、第 232 题:联邦学习 infra、第 233 题:disaster recovery、第 234 题:模型 CI/CD、第 235 题:observability。
10 万 QPS 设计、HPA VPA KEDA、MPS vs MIG、routing least loaded consistent hashing、CDN for models、A/B canary、streaming SSE、prompt caching、多模态 pipeline、safety guardrails、fine-tuning as a service、spot batching、Core ML TFLite、p99 latency SLO、admission control、ensemble cascade、request tracing、实时离线统一、security、carbon footprint。
第 236 题:10 万 QPS 推理服务、第 237 题:HPA VPA KEDA、第 238 题:MPS vs MIG 多模型、第 239 题:routing 策略、第 240 题:边缘 model caching CDN、第 241 题:A/B canary、第 242 题:streaming SSE、第 243 题:推理结果 caching、第 244 题:多模态 pipeline、第 245 题:safety guardrails、第 246 题:fine-tuning as a service、第 247 题:cost optimization、第 248 题:on-device Core ML TFLite、第 249 题:latency SLO p99、第 250 题:admission control、第 251 题:ensemble cascade、第 252 题:debuggability tracing、第 253 题:实时离线统一、第 254 题:security 加密认证、第 255 题:carbon footprint。
线程安全 memory pool、__shared__ bank conflict、ring buffer CPU-GPU、stream 与 event、thrust transform_reduce、CUTLASS gemm Epilogue、NCCL ring all-reduce、zero-copy cudaHostAlloc、P2P、CUDA Graph 捕获条件、template、RAII、CUDA_CHECK、warp shuffle、cooperative groups。
第 256 题:线程安全 memory pool、第 257 题:shared bank conflict、第 258 题:ring buffer CPU-GPU、第 259 题:stream event 同步、第 260 题:thrust transform_reduce、第 261 题:CUTLASS gemm Epilogue、第 262 题:NCCL ring all-reduce、第 263 题:zero-copy cudaHostAlloc、第 264 题:P2P cudaDeviceEnablePeerAccess、第 265 题:CUDA Graph 捕获条件、第 266 题:template metaprogramming、第 267 题:RAII unique_ptr deleter、第 268 题:CUDA error CUDA_CHECK、第 269 题:warp shuffle __shfl_sync、第 270 题:cooperative groups grid_group。
GIL、multiprocessing vs threading、asyncio aiohttp、tracemalloc、Cython vs pybind11、descriptor property、context manager、metaclass abc、import sys.path、pickle cloudpickle dill、cProfile line_profiler。
第 271 题:GIL multiprocessing threading、第 272 题:asyncio aiohttp、第 273 题:memory profiler tracemalloc、第 274 题:Cython pybind11、第 275 题:descriptor property、第 276 题:context manager、第 277 题:metaclass abc、第 278 题:import sys.path、第 279 题:pickle cloudpickle dill、第 280 题:cProfile line_profiler。
并发 LRU、external sort k-way merge、consistent hashing virtual node、bloom filter 假阳性、skip list、B+ tree、rate limiter token bucket leaky bucket、KMP prefix、shortest path Dijkstra Bellman-Ford、并查集 path compression。
第 281 题:并发 LRU cache、第 282 题:external sort k-way、第 283 题:consistent hashing、第 284 题:bloom filter 假阳性、第 285 题:skip list level、第 286 题:B+ tree 数据库、第 287 题:rate limiter、第 288 题:KMP prefix、第 289 题:shortest path、第 290 题:并查集 path compression。
TCP vs RDMA、InfiniBand Verbs ibv_post_send、RoCE ECN PFC、fat-tree dragonfly、NCCL bootstrap transport、jitter、DPDK、RDMA memory registration、SR-IOV virtio、跨 AZ。
第 291 题:TCP 与 RDMA、第 292 题:InfiniBand Verbs、第 293 题:RoCE v2 ECN PFC、第 294 题:fat-tree dragonfly、第 295 题:NCCL bootstrap transport、第 296 题:jitter 对训练影响、第 297 题:DPDK AI 网络、第 298 题:RDMA memory registration、第 299 题:SR-IOV vs virtio、第 300 题:跨 AZ 训练。
containerd、cri-o、CNI Calico Cilium、vGPU MIG SR-IOV、CSI 驱动、etcd 作用与调优。 最后一站:容器与集群底座。
第 301 题:containerd cri-o、第 302 题:CNI Calico Cilium、第 303 题:vGPU MIG SR-IOV、第 304 题:CSI 驱动、第 305 题:etcd 在 K8s 中作用与调优。
从 PyTorch Autograd 到 etcd 在 K8s 中的作用,这条漫游把 305 题 按「框架 → 算子/编译 → 分布式 → 显存/通信 → 推理/量化/服务 → 平台 → 语言/算法/网络/虚拟化」串成一条线。每一个可点击的链接都会带你到对应那道题的详解;读到哪、点到哪,像翻地图一样把 AI Infra 走一遍。
祝面试顺利。
本文为「AI Infra 工程师面经(305 题版)」漫游导读,所有链接指向本仓库内对应题目的 Markdown 文章。