算子开发到底在做什么?

"算子开发(Operator Kernel Development)"在真实工业环境里,绝对不只是"写一个 conv 的实现",而是:

围绕一个 Operator,在特定硬件 + 特定编译器 + 特定 workload 下,设计最优 kernel + schedule + memory layout + fusion 策略。

下面我给你一个完全真实的岗位工作分解(GPU / AI 加速器公司基本一致)。


一、算子开发到底在做什么(真实职责分层)

算子开发 ≠ 写算法

算子开发 =

复制代码
Operator Semantics
      ↓
Kernel Design
      ↓
Loop Schedule
      ↓
Memory Movement
      ↓
Hardware Mapping

二、你说的 "设计不同底层实现" ------ 是对的,但要具体到这 5 类工作

① Kernel 实现(最核心)

比如 Conv2D。

不会只有一个实现。

常见 kernel family:

复制代码
direct conv
im2col + GEMM
winograd
fft conv
implicit GEMM
tensorcore conv

算子开发做的就是:

为不同 shape / 硬件 / dtype 设计不同 kernel

例如:

复制代码
small batch → direct conv
large batch → tensorcore GEMM conv
1x1 conv → GEMM
depthwise → special kernel

② Schedule 设计(DL 编译器核心)

你应该非常熟悉这个层级(因为你做体系结构)。

他们会设计:

复制代码
tiling
blocking
loop reorder
unroll
vectorize
tensorize
pipeline

例如 TVM:

复制代码
s[C].tile(i,j,32,32)
s[C].tensorize(...)

本质:

复制代码
设计 loop nest 结构

③ Memory Layout & Dataflow 设计(真正的性能关键)

算子开发大量时间花在:

复制代码
NHWC vs NCHW
COL32 layout
TensorCore fragment layout
shared memory swizzle
bank conflict removal

因为:

性能瓶颈 70% 在 memory,而不是 compute


④ Kernel Fusion(现在最热门)

例如:

复制代码
matmul + bias + gelu + residual

算子开发会写:

复制代码
fused kernel

原因:

复制代码
减少 global memory traffic

FlashAttention 就是:

复制代码
attention 算子级 fusion

⑤ Auto-tuning & Kernel Selection

真实系统不会只有一个 kernel。

而是:

复制代码
kernel registry
+
shape-based dispatch

例如:

复制代码
if M<128 → kernel A
if head_dim=64 → kernel B
if bf16 → kernel C

三、一个真实 NVIDIA / ByteDance / Huawei 算子开发工作日

你可能会:

Step1

分析 profile:

复制代码
conv2d 占 40% latency

Step2

看 IR:

复制代码
lowered loop
memory access pattern

Step3

设计新 kernel:

复制代码
warp tile = 64x64
block tile = 128x128

Step4

写:

复制代码
CUDA
Triton
CUTLASS
TVM TensorIR
MLIR Linalg

Step5

调:

复制代码
occupancy
bank conflict
register pressure
L2 hit rate

四、不同公司的"算子开发"差别非常大(这是关键)

1️⃣ GPU 公司(NVIDIA / AMD)

重点:

复制代码
TensorCore mapping
warp-level MMA
PTX
CUTLASS

2️⃣ AI Compiler 公司(TVM / ByteDance / OpenAI infra)

重点:

复制代码
IR lowering
schedule search
fusion
autotuning

3️⃣ AI 芯片公司(寒武纪 / 华为昇腾 / 壁仞)

重点:

复制代码
mapping to NPU dataflow
on-chip SRAM scheduling
DMA orchestration

4️⃣ LLM Infra 公司(DeepSeek / Anthropic infra)

重点:

复制代码
fused transformer kernels
flash attention
kv-cache kernels
quant kernels

五、一个非常重要的认知(90%新人完全误解)

算子开发:

❌ 不是写 PyTorch operator

❌ 不是写算法

❌ 不是写模型

而是:

复制代码
写 HPC Kernel
+
写 Compiler Schedule
+
写 Hardware Mapping

本质岗位:

AI 时代的 HPC Kernel Engineer


六、基于你的背景(体系结构 + ysyx + Verilog)

我非常明确告诉你:

你其实非常适合做:

复制代码
AI Hardware Mapping 型算子开发

比普通 CS 出身更适合。

因为你已经理解:

复制代码
loop
dataflow
memory hierarchy

而这些就是算子优化的核心。


相关推荐
styshoo1 天前
NVSentinel 数据流梳理
kubernetes·gpu·ai-infra·nvsentinel
武子康1 天前
调查研究-220 Batching 才是 GPU Serving 的第一性原理
人工智能·llm·gpu
武子康1 天前
调查研究-219 GPU 为什么能快,也为什么容易被大量小请求拖慢?
人工智能·llm·gpu
算力百科小星1 天前
GPU算力平台生态能力全景矩阵:四维生态图谱与平台适配度深度评估
gpu算力·gpu·gpu算力租用
csdndeyeye1 天前
27届校招的工程化挑战:信息碎片化与状态管理缺失
自动化·秋招·校招·就业·求职助手·应届生就业·网申海投
算力百科小星2 天前
GPU算力平台可靠性评估体系:五维二十五项指标的八家主流平台量化横评
gpu算力·gpu
wumingxiaoyao3 天前
从 0 开始学 AI:第 4 课,CPU、GPU、显存和算力基础
人工智能·ai·cpu·gpu·显存
Hi202402174 天前
RTX-5090 基础测试
gpu
Smoothcloud_润云15 天前
Hermes Agent 的上下文记忆机制:一个开源 Agent 是怎么"记住"你的
人工智能·agent·gpu
RainbowC020 天前
CUDA软件实现跨线程块同步
gpu