Files
CTI-Inference-Opt/README.md

61 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CTI-Inference-Opt
百度商业AI技术创新大赛 (CTI) 2026 — **生成式推荐广告排序推理性能优化**
[![Gitea](https://img.shields.io/badge/Gitea-Serendipity%2FCTI--Inference--Opt-blue?logo=gitea)](https://gitea.liuhangyv.top/Serendipity/CTI-Inference-Opt)
## 赛题
> [比赛主页](https://aistudio.baidu.com/competition/detail/1461) · [大赛官网](http://cti.baidu.com) · [提交结果](https://aistudio.baidu.com/competition/detail/1461/0/submit-result)
给定基于 Transformer 的生成式推荐广告排序模型(GRAB),在**不改变模型结构、不在测试集上训练**的前提下,极致优化推理性能。
量化、稀疏、剪枝明确允许。
## 模型架构
```
RepEncoder (28 slots × 512d Embedding)
→ 8 层 Transformer (512d, 8 heads, Pre-LN)
→ Multi-Head Attention
→ SMoE FFN (8 experts, Top-2 gating)
→ Linear → Sigmoid → CTR
```
~6.5M~11.3M 参数,基于 [GRAB](https://arxiv.org/abs/2602.01865) / [HSTU](https://arxiv.org/abs/2402.17152) 论文。
## 评分规则
> 详见 [比赛规则](https://aistudio.baidu.com/competition/detail/1461/0/rules)
| 维度 | 要求 | 不达标 |
|------|------|--------|
| 推理效率 | ≤ 5min,环境构建 ≤ 20min | **总分 0** |
| 模型效果 | AUC ≥ 0.65PCOC ∈ [0.85, 1.15] | **总分 0** |
## 优化路线
| 步骤 | 方案 | 预期加速 |
|------|------|----------|
| ✅ 第一版 | 接口对齐 + FP16 量化 | 229s → ~120s |
| 🔲 第二版 | Flash Attention + torch.compile | ~120s → ~65s |
| 🔲 第三版 | MoE 剪枝 + INT8 量化 | ~65s → ~30s |
## 提交
```bash
cd 代码/code
zip submit.zip infer.py requirements.txt build_env.sh
```
约束:不包含 `dataset/``ckpt.pt`,每天最多 10 次提交。
## 环境
- **本地**: `.venv` (Python 3.13, uv), 仅装 `numpy` + `tqdm` + `aistudio-sdk`
- **服务端**: PyTorch 2.6.0 + CUDA 12.4,完整依赖见 `代码/code/requirements.txt`
## 许可证
MIT License