[Benchmark Integrity] ShiftingMemoryPoolAllocator pointer-shift caching (a9fa080) & post-timing audit request
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
調査の方向性
Start with ShiftingMemoryPoolAllocator._compute_offset_blocks and get_unique_args in src/sol_execbench/core/bench/io.py, then the call sites in eval_driver.py and timing.py. Reproducing the stale-output exploit on L1/003 is the first step. Done means an optional post-timing audit flags cached outputs after input contents change, while the CUPTI-measured loop stays unchanged. Maintainer design input is needed first.
索引モデルが issue の本文から書いたものです。
説明
Summary
Following up on issues #15 and #19, the maintainer discussion in PR #20, and Yue Shui's post ("Reward Hacking in GPU Kernel Optimization: Loopholes and Defenses in SOL-ExecBench", https://syhya.github.io/posts/2026-11-24-gpu-kernel-reward-hacking/), I reproduced cross-call address-shift caching end-to-end on both the online NVIDIA B200 web evaluator (L1/003, L1/036) and the local SOL-ExecBench v1.1 evaluator (commit a9fa080) across L1, FlashInfer-Bench, and Quant (L2 shares the same driver/allocator code path and was not evaluated locally in this run).
I understand the maintainers' rationale in PR #20 against inserting output checks inside the timed loop (to preserve measurement reliability) and relying on async online review. However, two practical gaps remain:
- Immediate online B200 web evaluation still returns near-1.0 scores (
1.000000on003,0.998662on036) with~2.1 µsmeasured latency and16 / 16correctness. - Local
sol-execbenchusers have no optional out-of-loop post-timing audit mode to catch stale timed-path outputs offline without disturbing CUPTI measurements.
Root Cause (Commit a9fa080)
-
src/sol_execbench/core/bench/io.py:594-629(ShiftingMemoryPoolAllocator._compute_offset_blocks):_POOL_ALIGNMENT = 256 _MAX_SHIFT_BYTES = 2048 ... for _ in range(max(0, total_iterations - 1)): offsets.append(offsets[-1] + rng.randint(1, max_multiplier))Every iteration shifts all input/output tensors by a shared, strictly positive cumulative multiple of 256 bytes in
[256, 2048]. -
src/sol_execbench/core/bench/io.py:693-705(ShiftingMemoryPoolAllocator.get_unique_args):
Each timed call copies the exact sameentry["source"]bytes into the newly shifted pool slice—onlytensor.data_ptr()changes, never the logical values. -
src/sol_execbench/driver/templates/eval_driver.py:584-597&src/sol_execbench/core/bench/timing.py:155-207, 343-356:
Numerical correctness finishes beforetime_runnable()starts; during warmup, discovery, and timed iterations, candidate return values are discarded (_ = fn(*args)).
Minimal Reproduction Logic (e.g., L1/003 and L1/036)
Taking 003_lm_head_projection_with_logit_slicing (large BF16 LM-head GEMM) and 036_flux_output_norm_projection_chain (LayerNorm + modulation linear projection + output linear projection) as concrete examples:
- Pre-timing correctness rounds (
gen_inputs): Fresh allocations do not advance along a uniform[256, 2048] Bprogression across consecutive calls, sois_pool_shiftisFalse. The candidate computes the exact reference output and caches(cur_ptrs, cached_out, marker, streak=0)keyed by tensor shapes, dtypes, device, and scalar parameters (e.g.,slice_sizefor003orepsfor036). - Timing path (
ShiftingMemoryPoolAllocator): Warmup + discovery + timed calls advance all input pointers by identical 256-byte-aligned deltas in[256, 2048] B. Once consecutive matching shifts reachstreak >= 3(which also avoids accidental ~1 KB allocator collisions on tiny tensors such asFlashInfer/022), the candidate skips all real compute, launches a 1-thread@triton.jitmarker kernel to satisfy CUPTI activity checks, and returnscached_out.
Illustrative pseudocode:
import torch
import triton
import triton.language as tl
_cache = {} # key -> (prev_ptrs, cached_out, marker, streak)
@triton.jit
def _marker_kernel(marker_ptr):
tl.store(marker_ptr, 1)
def run(*args):
key = tuple(
(a.shape, a.dtype, str(a.device)) if isinstance(a, torch.Tensor) else a
for a in args
)
ptrs = tuple(a.data_ptr() for a in args if isinstance(a, torch.Tensor))
prev_ptrs, cached_out, marker, streak = _cache.get(key, (None, None, None, 0))
deltas = [c - p for c, p in zip(ptrs, prev_ptrs)] if prev_ptrs else []
is_pool_shift = (
len(deltas) > 0
and len(set(deltas)) == 1
and 256 <= deltas[0] <= 2048
and (deltas[0] % 256) == 0
)
streak = (streak + 1) if is_pool_shift else 0
if streak >= 3 and cached_out is not None:
_marker_kernel[(1,)](marker, num_warps=1) # satisfies CUPTI discovery/timing
_cache[key] = (ptrs, cached_out, marker, streak)
return cached_out
out = exact_reference_impl(*args)
marker = marker if marker is not None else torch.empty((), dtype=torch.int32, device=out.device)
_cache[key] = (ptrs, out, marker, streak)
return out
Because returned outputs are unverified after eval_driver.py:584, the evaluator bills only _marker_kernel (~0.6–2.1 µs).
Empirical Reproduction Results
A. Online SOL-ExecBench Web Platform Reproduction (NVIDIA B200)
| Operator | Platform / Hardware | Score | Measured Latency | Correctness | Apparent Speedup |
|---|---|---|---|---|---|
003_lm_head_projection_with_logit_slicing |
Online web evaluator (B200) | 1.000000 |
0.002149 ms |
16 / 16 = 1.00 |
177.25× |
036_flux_output_norm_projection_chain |
Online web evaluator (B200) | 0.998662 |
0.002108 ms |
16 / 16 = 1.00 |
33.75× |
B. Local NVIDIA H200 Cross-Suite Reproduction (SOL-ExecBench v1.1, a9fa080, paired UUIDs)
Environment: NVIDIA H200 (PyTorch 2.9.0+cu130, Triton 3.7.0, CUDA 13.0). All speedups below are computed strictly over paired workload UUIDs present in both reference and candidate traces:
| Suite | Ops Evaluated | Workloads Status in Local v1.1 Evaluator |
Candidate Geomean Latency | Peak Paired-UUID Fake Speedup vs Ref |
|---|---|---|---|---|
L1 (033, 003, 036) |
3 / 3 |
All tested workloads (48 / 48) returned PASSED (003: 0.630 µs, 036: 0.628 µs, both 16/16) |
0.000628 – 0.000953 ms |
1,212.5× (003, 16/16 paired UUIDs) |
FlashInfer-Bench (001..026) |
26 / 26 |
All tested workloads (452 / 452 out of 660 total) returned PASSED (all 48 candidate workloads on 012 passed) |
~0.0006 – 0.0008 ms |
30,059.1× (012, 6 shared UUIDs) |
| Quant (FP8 H200 subset) | 18 / 33 (15 NVFP4 B200-only) |
All tested workloads (278 / 278 H200 FP8) returned PASSED |
~0.0006 – 0.0007 ms |
25,159.5× (015, ~25.2k×, 16 paired UUIDs) |
| L2 | Not evaluated locally | Shares the same ShiftingMemoryPoolAllocator / eval_driver path |
— | — |
Proposal: Out-of-Loop Post-Timing Cache Audit & Acceptance Criteria
To address PR #20's concern about in-loop timing interference, sol-execbench can keep the measured CUPTI loop 100% unchanged and provide an optional post-timing audit pass (e.g., --audit-timing-cache) after time_runnable() completes:
- Same-Allocator Mutated Replay (Out-of-Loop):
- Replay a
ShiftingMemoryPoolAllocatorsequence with the identical256..2048 Bpointer-shift pattern, mutateentry["source"]contents in-place—covering both floating-point tensors and integer index tensors (e.g.,int64 position_idsin RoPE ops likeQuant/014)—and validate outputs (including stricttype(t) is torch.Tensorviacheck_lazy_outputs()) against a fresh reference.
- Replay a
- Independent Per-Tensor Shifts (Defense-in-Depth):
- Randomize per-tensor offsets independently (non-monotonic positive/negative shifts across varying alignment steps rather than a shared monotonic
+256..2048 Bprogression).
- Randomize per-tensor offsets independently (non-monotonic positive/negative shifts across varying alignment steps rather than a shared monotonic
Acceptance Criteria
- Changing valid input contents (both floating-point and integer tensors) on the same shifted allocation path flags any solution returning stale/cached outputs as
REWARD_HACK. - Measured CUPTI latency remains completely unaffected, and audit pass/fail status and audit overhead are reported separately.
Local Audit Validation (No false positives observed in 48 local controls)
- Evaluated locally on H200 using the smallest workload per operator across all 47 address-shift negative controls and 48 legitimate controls (4 optimized
L1CUDA C++/Triton solutions + 44 suite reference implementations acrossFlashInfer-BenchandQuantFP8):- Address-shift caching detections: 47 / 47 (100.0%) flagged by post-warmup mutated-pool validation.
- Legitimate controls: 0 / 48 (0.0%) false positives.
- 主要言語
- Python
- スター
- 340
- フォーク
- 37
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/SOL-ExecBench のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/SOL-ExecBench#27 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
NVIDIA/SOL-ExecBench#29 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
NVIDIA/SOL-ExecBench#25 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
NVIDIA/SOL-ExecBench#21 ·
NVIDIA/SOL-ExecBench の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vllm-project/vllm#70030 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TigreGotico/tugaphone#408 ·
メンテナーはふだん 1 日以内に返信
-
t: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
Azure/azure-sdk-for-python#50155 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信