计算机使用智能体分类English
R03.03.01.03 · 任务小类

模型压缩、转换与推理优化

Model compression, conversion & inference optimization

Compress, quantize, convert or reshard models and checkpoints, and write or speed up GPU kernels and inference paths, to correctness, quality and speed targets.

20 条本项目编写的提案 · 分类 v1.1 · 新增基准运行 0 次。下方验证方式与部分得分规则是设计,不是执行结果。

典型应用
CUDA · Triton · PyTorch
小类 GUI 需求标签
CL · CLI 足够

任务提案 · 20

展开查看完整原文与建议检查方式;两种界面均保留提案英文原文。

R03.03.01.03-T01 Write a Triton row-softmax faster than PyTorch

原始指令

Implement softmax over the last dimension in Triton (kernels/softmax.py) for fp16 inputs of shapes in bench/shapes.json (rows 1k–64k, cols 128–8192). It must be numerically stable and faster than torch.softmax on the provided A100.

平台
lin · Linux
应用
Triton · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
2 / 5

建议验证方式

Grader checks max abs error ≤2e-3 vs fp32 reference on all shapes including large-magnitude inputs; geometric-mean speedup over torch.softmax ≥1.2× (linear from 1.0×) measured with triton.testing.do_bench. Calls to torch.softmax inside the kernel path fail.

建议部分得分

40% correctness incl. stability cases; 60% speedup

R03.03.01.03-T02 Fuse LayerNorm forward and backward in CUDA

原始指令

Write a CUDA extension (csrc/layernorm.cu) implementing fused LayerNorm forward and backward (weight, bias, fp16/bf16 in, fp32 accumulation) and register it as a torch.autograd.Function. Beat torch.nn.functional.layer_norm on hidden sizes 768–8192.

平台
lin · Linux
应用
CUDA · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader: forward and gradients (x, w, b) match PyTorch within 1e-2 (bf16) / 5e-3 (fp16) on 12 shapes; gradcheck in fp64 on small shapes passes; combined fwd+bwd speedup ≥1.3× geometric mean (linear from 1.0×).

建议部分得分

25% forward correctness; 30% backward correctness; 45% speedup

R03.03.01.03-T03 Fuse conv, bias and ReLU to beat separate ops

原始指令

For the KernelBench-style module in tasks/conv_bias_relu.py (Conv2d 3×3, bias, ReLU; fp16, NCHW batch 32), write ModelNew that fuses the operations with a custom Triton or CUDA kernel and is faster than the reference module.

平台
lin · Linux
应用
Triton · CUDA · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader runs 5 random inputs: outputs within 1e-2 of reference; speedup vs reference ≥1.15× (linear from 1.0×) on the grader GPU. Using cuDNN conv plus a fused epilogue is allowed; calling the reference module is not (AST check).

建议部分得分

40% correctness; 60% speedup

R03.03.01.03-T04 Implement a FlashAttention-style forward kernel in Triton

原始指令

Implement causal multi-head attention forward in Triton (kernels/attn_fwd.py) with online softmax and tiling, for fp16, head dims 64 and 128, sequence lengths 512–16k. Match F.scaled_dot_product_attention numerically and approach its speed.

平台
lin · Linux
应用
Triton · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
5 / 5

建议验证方式

Grader: max abs error ≤2e-2 vs fp32 reference on 16 configs; memory use O(N) (16k tokens must not OOM on 40 GB); throughput ≥70% of SDPA's flash backend TFLOPs (linear from 30%). Calling SDPA in the path fails.

建议部分得分

35% correctness; 15% memory scaling; 50% relative throughput

R03.03.01.03-T05 Write an INT8 tensor-core GEMM with CUTLASS

原始指令

Implement an int8×int8→int32 GEMM with per-row/per-column dequantization epilogue to fp16 using CUTLASS 3 (csrc/gemm_int8.cu), exposed to PyTorch, for M,N,K multiples of 128 up to 8192. Target throughput comparable to cuBLASLt int8.

平台
lin · Linux
应用
CUDA · CUTLASS · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader: results equal a reference int32 matmul + dequant within fp16 rounding; throughput ≥80% of cuBLASLt int8 on 6 shapes (linear from 40%). Uses tensor-core MMA (Nsight Compute metric sm__inst_executed_pipe_tensor > 0).

建议部分得分

40% correctness; 15% tensor cores used; 45% throughput

R03.03.01.03-T06 Speed up a PyTorch inference service with compile and CUDA graphs

原始指令

serve/embedder.py embeds text with a 300M encoder at 410 req/s on one L4 GPU. Raise throughput to ≥900 req/s at batch-arrival pattern bench/load.json without changing outputs, using techniques such as torch.compile, CUDA graphs, padding buckets and pinned memory.

平台
lin · Linux
应用
PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader replays the load: throughput ≥900 req/s (linear from 410); p99 latency ≤80 ms; embeddings cosine ≥0.9999 vs original for 5k inputs.

建议部分得分

60% throughput; 20% p99 latency; 20% output parity

R03.03.01.03-T07 Tune a vLLM deployment for a latency and throughput SLO

原始指令

Serve models/llama_8b with vLLM on 1×A100 so the trace in bench/chat_trace.jsonl achieves p99 time-to-first-token ≤800 ms and ≥2,400 output tokens/s. Choose settings (max-num-seqs, chunked prefill, prefix caching, quantization of KV cache) and record them in output/serve.sh.

平台
lin · Linux
应用
vLLM · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP08 · 应用 / 系统状态
条件
未声明
提案难度
4 / 5

建议验证方式

Grader launches output/serve.sh and replays the trace with the benchmark client: TTFT p99 and tokens/s targets (linear credit each); greedy outputs on 50 prompts must match fp16 baseline ≥96% token agreement.

建议部分得分

40% TTFT p99; 40% throughput; 20% output fidelity

R03.03.01.03-T08 Implement INT8 KV-cache quantization with bounded quality loss

原始指令

Add per-head INT8 KV-cache quantization to the decoding loop in repo/minillm (custom attention), halving KV memory, with perplexity on data/wikitext_val no more than 0.15 above fp16.

平台
lin · Linux
应用
PyTorch · Triton
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader measures KV-cache bytes per token (≤52% of fp16), perplexity delta ≤0.15 (linear to 0.5), and decode tokens/s not below 95% of fp16 at batch 16.

建议部分得分

35% memory reduction; 40% perplexity delta; 25% speed retained

R03.03.01.03-T09 Write a fast prefix-sum kernel

原始指令

Implement an inclusive prefix sum for int32 and fp32 arrays up to 2^28 elements in CUDA or Triton (kernels/scan) that is correct and at least as fast as torch.cumsum on the grader GPU.

平台
lin · Linux
应用
CUDA · Triton
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader: exact match for int32; fp32 within 1e-3 relative of fp64 reference; speedup vs torch.cumsum ≥1.0× on 5 sizes (linear credit to 1.5×). Non-power-of-two sizes tested.

建议部分得分

45% correctness; 55% speed

R03.03.01.03-T10 Find and fix a memory-coalescing bottleneck with Nsight Compute

原始指令

kernels/transpose_add.cu runs at 18% of peak memory bandwidth. Profile it in the Nsight Compute GUI, identify the uncoalesced access and bank conflicts, fix them with shared-memory tiling, and save before/after reports to output/*.ncu-rep.

平台
lin · Linux win · Windows
应用
Nsight Compute · CUDA
交互表面
desk · 桌面 GUI term · 终端
GUI 需求 · 任务设定
HY · 混合
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
vis · 视觉判断 code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader: output correct; achieved DRAM throughput ≥70% of peak (ncu metric) and runtime ≥3× faster; both .ncu-rep files exist and the after report shows shared-memory bank conflicts ≤1% of wavefronts.

建议部分得分

20% correctness; 50% bandwidth/speedup; 30% reports evidence the fix

R03.03.01.03-T11 Write a Metal compute shader for Gaussian blur on Apple silicon

原始指令

In fixtures/MetalBlur (Swift + Metal, macOS 14), implement a separable 15-tap Gaussian blur compute kernel for 4K RGBA16F textures that matches the CPU reference and runs in under 2 ms on the test Mac's GPU. Profile with Xcode's GPU frame capture.

平台
mac · macOS
应用
Xcode · Metal
交互表面
desk · 桌面 GUI term · 终端
GUI 需求 · 任务设定
HY · 混合
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令 vis · 视觉判断
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader runs the test binary: per-pixel max error ≤1e-3 vs CPU reference on 5 images; GPU time (MTLCommandBuffer GPUEndTime−GPUStartTime) median ≤2 ms; uses threadgroup memory (shader source check).

建议部分得分

45% correctness; 45% timing; 10% threadgroup tiling

R03.03.01.03-T12 Fit a model's fine-tuning into 16 GB of GPU memory

原始指令

repo/finetune_1b OOMs on a 16 GB GPU at batch 8, seq 2048. Make it fit using bf16 autocast, activation checkpointing and fused optimizer states, keeping the effective batch and loss curve unchanged.

平台
lin · Linux
应用
PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
2 / 5

建议验证方式

Grader runs 200 steps on a 16 GB-limited GPU: no OOM, peak memory ≤15.5 GB; loss at step 200 within ±2% of the reference run; step time ≤1.6× of the reference on an 80 GB GPU.

建议部分得分

50% fits in memory; 30% loss parity; 20% step time

R03.03.01.03-T13 Implement speculative decoding with a draft model

原始指令

Add speculative decoding to repo/minillm using models/draft_160m as the draft for models/target_1b: k-token proposals, rejection sampling that preserves the target distribution, and greedy and sampled modes. Achieve ≥1.8× decode speedup at batch 1.

平台
lin · Linux
应用
PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
5 / 5

建议验证方式

Grader: greedy outputs identical to target-only decoding on 100 prompts; sampled-mode token distribution matches target (χ² test on 20k samples, p>0.01); speedup ≥1.8× (linear from 1.0×); acceptance rate logged.

建议部分得分

35% greedy equivalence; 25% distribution preserved; 40% speedup

R03.03.01.03-T14 Convert a detector to TensorRT FP16 with dynamic shapes

原始指令

Export models/detector.pt to ONNX and build a TensorRT FP16 engine with dynamic batch 1–16 and input sizes 512–1024, reaching p50 latency ≤6 ms at batch 1, 640×640 on the grader GPU while keeping mAP within 0.5 points.

平台
lin · Linux
应用
TensorRT · PyTorch · ONNX
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader loads the engine with trtexec-equivalent harness: latency targets; mAP on data/val subset within 0.5 of FP32 PyTorch; engine accepts all shape profiles.

建议部分得分

40% latency; 40% accuracy; 20% dynamic shape profiles

R03.03.01.03-T15 Fix a race condition in a CUDA histogram kernel

原始指令

kernels/histogram.cu gives slightly different counts on every run for 256-bin byte histograms. Fix the race without making it slower than 1.2× the current (incorrect) runtime, using shared-memory privatization.

平台
lin · Linux
应用
CUDA
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
2 / 5

建议验证方式

Grader runs 50 times on 6 inputs including skewed distributions: counts exact every run; runtime ≤1.2× baseline; compute-sanitizer racecheck reports zero hazards.

建议部分得分

60% exact counts across runs; 20% racecheck clean; 20% runtime bound

R03.03.01.03-T16 Write a custom CUDA gather-scatter op with autograd

原始指令

Implement a fused segment-sum op (CSR-style segments) as a PyTorch C++/CUDA extension with forward and backward, supporting fp32/fp16 and up to 50M elements, and make it faster than torch_scatter on bench/segments.json.

平台
lin · Linux
应用
CUDA · PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader: forward exact vs reference (fp32) / 1e-2 (fp16); gradcheck passes; empty segments handled; speedup vs torch_scatter ≥1.2× geometric mean (linear from 1.0×).

建议部分得分

30% forward; 30% backward/gradcheck; 40% speedup

R03.03.01.03-T17 Quantize LLM weights to 4-bit with bounded perplexity loss

原始指令

Quantize models/llama_3b to 4-bit weights (GPTQ or AWQ, group size 128) using data/calib_512.jsonl, load it for inference, and keep wikitext-2 perplexity within +0.3 of fp16 while reducing weight memory by ≥3.5×.

平台
lin · Linux
应用
PyTorch · AutoGPTQ
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader evaluates perplexity with the fixed script (stride 512): delta ≤0.3 (linear to 1.0); weight bytes ≤ fp16/3.5; generation on 20 prompts runs without errors.

建议部分得分

50% perplexity delta; 35% memory reduction; 15% inference works

R03.03.01.03-T18 Remove CPU-GPU sync points from a training loop

原始指令

repo/train_loop.py runs at 310 ms/step with a GPU utilization of 55%. Use the PyTorch profiler to find host-device syncs (.item(), nonzero, print of tensors, pin_memory misuse) and remove them so step time drops to ≤200 ms with identical training results.

平台
lin · Linux
应用
PyTorch
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Grader: mean step time over 100 steps ≤200 ms (linear from 310); loss trajectory equals the original within 1e-5 for 50 steps (same seed); profiler trace shows ≤2 cudaStreamSynchronize per step.

建议部分得分

60% step time; 25% numerical parity; 15% sync count

R03.03.01.03-T19 Write a CSR SpMV kernel competitive with cuSPARSE

原始指令

Implement sparse matrix-vector multiply for CSR fp32 matrices (kernels/spmv.cu) that adapts to row-length distribution (vector vs warp-per-row), and benchmark against cuSPARSE on the 8 SuiteSparse matrices in data/.

平台
lin · Linux
应用
CUDA · cuSPARSE
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader: results within 1e-4 relative of fp64 reference on all matrices; throughput ≥90% of cuSPARSE geometric mean (linear from 50%); power-law matrices included.

建议部分得分

40% correctness; 60% throughput vs cuSPARSE

R03.03.01.03-T20 Maximize single-GPU LLM decode throughput end to end

原始指令

Raise batch-16 decode throughput of repo/minillm (1B model, fp16) on one A100 from 1,150 to ≥3,000 tokens/s by combining techniques: fused QKV and MLP kernels, paged KV cache, CUDA graphs and a fused sampling kernel. Outputs must match the baseline under greedy decoding.

平台
lin · Linux
应用
PyTorch · Triton · CUDA
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
long · 长流程
提案难度
5 / 5

建议验证方式

Grader: tokens/s at batch 16, 512 prompt + 512 generated ≥3,000 (linear from 1,150); greedy outputs identical on 64 prompts; memory ≤ baseline; no external inference engine imported (vLLM, TensorRT-LLM banned).

建议部分得分

65% throughput; 25% output identity; 10% memory bound

已有研究映射

以下沿用研究目录中的基准与小类映射,不是逐题标注、执行记录或产品背书。

同工作流族的小类