forked from metax-maca/op_optimization
<docs>(flashinfer): gitlink格式适配
This commit is contained in:
parent
a5cbd78004
commit
10d459e808
|
|
@ -566,14 +566,14 @@ FlashInfer 方向包含 **4 个可选算子题目**,每个对应独立的 benc
|
|||
- **固定参数**:`num_qo_heads = 32`、`num_kv_heads = 4`、`head_dim_qk = 128`、`head_dim_vo = 128`、`causal = 1`、数据类型 `bfloat16`
|
||||
- **可变参数**(共 **12 个测试用例**):
|
||||
|
||||
| batch_size | seq_len | 估算 Q 张量大小 | 估算 KV 张量大小 |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 1 | 1024 | 1×1024×32×128×2B = 8 MB | 2×1×1024×4×128×2B ≈ 2 MB |
|
||||
| 1 | 4096 | 32 MB | 8 MB |
|
||||
| 1 | 8192 | 64 MB | 16 MB |
|
||||
| 1 | 16384 | 128 MB | 32 MB |
|
||||
| 4 | 1024~16384 | 32 MB ~ 512 MB | 8 MB ~ 128 MB |
|
||||
| 16 | 1024~16384 | 128 MB ~ 2 GB | 32 MB ~ 512 MB |
|
||||
| batch_size | seq_len | 估算 Q 张量大小 | 估算 KV 张量大小 |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 1 | 1024 | 1×1024×32×128×2B = 8 MB | 2×1×1024×4×128×2B ≈ 2 MB |
|
||||
| 1 | 4096 | 32 MB | 8 MB |
|
||||
| 1 | 8192 | 64 MB | 16 MB |
|
||||
| 1 | 16384 | 128 MB | 32 MB |
|
||||
| 4 | 1024~16384 | 32 MB ~ 512 MB | 8 MB ~ 128 MB |
|
||||
| 16 | 1024~16384 | 128 MB ~ 2 GB | 32 MB ~ 512 MB |
|
||||
|
||||
- **精度要求**:`torch.allclose(output.float(), output_ref.float(), rtol = 1e-2, atol = 1e-2)`
|
||||
- **显存上限**:OJ 评测环境设计 `VRAM_SIZE = 48 GB`(见 `testcase_config.py`)
|
||||
|
|
@ -661,7 +661,7 @@ FlashInfer 方向包含 **4 个可选算子题目**,每个对应独立的 benc
|
|||
|
||||

|
||||
|
||||
**参考 prompt:**
|
||||
**参考 prompt** 及 **20001 FlashInfer Ragged Prefill 参考冒烟代码**:
|
||||
|
||||
```plaintext
|
||||
# FlashInfer Ragged Prefill CUDA Kernel — Problem 20001
|
||||
|
|
@ -847,12 +847,9 @@ FlashInfer 方向包含 **4 个可选算子题目**,每个对应独立的 benc
|
|||
15. All kernel pointers `__restrict__`. warp_sum in namespace. Only code output — no markdown.
|
||||
|
||||
**Common errors**: (1) `-INFINITY` for m → NaN; use `-1.0e20f`. (2) Missing alpha guard → exp(1e20) overflow. (3) K/V ptr uses 32 instead of 4 → wrong stride (4096 vs 512). (4) Output ptr uses kv_head instead of qo_head → 8 heads write to same location. (5) `sum/t` divides by zero at t=0; use `sum/(t+1)`. (6) Signed `0xffffffff` mask → UB; use `0xffffffffu`.
|
||||
|
||||
```
|
||||
|
||||
|
||||
**20001 FlashInfer Ragged Prefill 参考冒烟代码:**
|
||||
|
||||
```cpp
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue