AWP Profiling API
概述
AWP Profiling API 提供异步 GPU/CPU 性能分析能力。用户提交采集任务后,后台自动采集并分析,通过查询接口获取结果。
- Base URL:
https://awpai-backend.alibaba-inc.com - 认证:提交接口需 API Key(
X-API-Keyheader);查询接口无需认证
核心流程
获取 API Key → 提交任务 → 轮询状态 → 拉取结果
状态流转:pending → running → finished → analyzing → completed(异常:failed / timeout / cancelled)
接口列表
提交任务
POST /api/v1/profiling/awp_profiling
需要 X-API-Key 认证。请求体包含 target(目标 pod)和 config(采集配置)。
查询状态
GET /api/v1/profiling/awp_profiling/{profileId}
无需认证,建议 5-10s 间隔轮询。
查询结果(completed 后可用)
| 数据 | 接口 | 必填参数 |
|---|---|---|
| TopKernels | GET .../awp_profiling/{id}/top_kernels | ?gpuId=<id> |
| Critical Path | GET .../awp_profiling/{id}/critical_path | ?gpuId=<id> |
| Python 调用栈 | GET .../awp_profiling/{id}/python_result | ?gpuId=<id> |
| Perf Event | GET .../awp_profiling/{id}/perf_event | 无 |
Target 定位
podSN / podName / podIP 三选一(优先级 podSN > podName > podIP)。仅传 podIP 时后端自动反查补齐 nodeSN、podName、GPU 型号。
采集类型
| 类型 | 用途 | 推荐 duration |
|---|---|---|
gpu_kernel | GPU Kernel 性能分析 | 20-30s |
python_stack | Python CPU 热点 | 20-30s |
off_cpu | 阻塞/IO/锁等待 | 15-30s |
perf_event | CPU 微架构(cache/branch 等) | 10-20s |
可同时提交多种类型进行联合采集。
进阶选项
gpu_kernel.options.gpu_kernel_with_python: true:同时采集 Python 调用栈perf_event.options.event:指定 perf 事件类型(默认cpu-clock,可选cycles/cache-misses等)
错误码
| HTTP | 含义 | 处理 |
|---|---|---|
| 400 | 参数错误 | 按 message 定位 |
| 401 | API Key 无效/缺失 | 重新生成 |
| 429 | 限流 | 按 Retry-After 退避 |
| 500 | 后端异常 | 联系团队 |
限流维度为 nodeSN + podSN/podName + jobID。
使用示例
# 提交 GPU kernel 采集(20s,附带 Python 栈)
curl -X POST 'https://awpai-backend.alibaba-inc.com/api/v1/profiling/awp_profiling' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: <your-api-key>' \
-d '{
"target": { "podIP": "10.0.0.1", "jobID": "my-job" },
"config": {
"profilingTypes": ["gpu_kernel"],
"gpu_kernel": {
"duration": 20,
"options": { "gpu_kernel_with_python": true, "python_duration": 10 }
}
}
}'
# 查询状态
curl 'https://awpai-backend.alibaba-inc.com/api/v1/profiling/awp_profiling/{profileId}'
相关页面
← 被以下页面引用(3)
- AMD MI308X 单卡 Profile 分析摘要(kernel_launch_bound 主导)ai-systems · source-summary
- FT vs VLLM vs SGLang 推理框架对比摘要ai-systems · source-summary
- H20 批量归因分析报告摘要ai-systems · source-summary
修改历史
修改历史2 次提交
- feat: SEO + cross-references + Lighthouse fixxiaocheng··
127a349 - feat(wiki): ingest 4 raw articles + split inference survey into 5 pagesxiaocheng··
0521533