Skip to content

feat: add sampling-path and temperature=0 diagnostics - #4

Merged
0Chencc merged 1 commit into
mainfrom
feat/sampling-temp-diagnostics
Dec 2, 2026
Merged

0Chencc merged 1 commit into
mainfrom
feat/sampling-temp-diagnostics

Conversation

@0Chencc

@0Chencc 0Chencc commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add ledger/sampling.py to classify greedy vs. stochastic sampling kernels (excluding MoE routing top-k), detect lm_head + logits-sized DtoH (>= 256 KiB) host-fallback sampling, compare sampling modes across captures, and audit Sibyl deployment profile.json sampling_policy.
  • Wire sampling accounting and ## Sampling into ledger/analyze.py, flagging silent temp=0 fallback (declared temperature > 0 with only greedy kernels), host-fallback DtoH sampling, and greedy temperature=0 decode captures (also ensuring zero-ms Findings notes render when no >0.5 ms timing finding exists).
  • Flag greedy vs. stochastic or temperature mismatches in ledger/diff.py.
  • Add --profile (with co-located auto-detection) and --fail-on-sampling to ledger/sibyl_audit.py to catch sampling_default_temperature=0, sampling_thinking_temperature=0, and profile-vs-kernel mismatches.
  • Add --temperature / --top-p flags and run.json recording to ledger/profile.py, examples/vllm_decode.py, and ledger/ascend_import.py.
  • Add tests/test_sampling.py.

Verification

  • pytest tests: 62/62 passed.

… diff, and sibyl-audit

- Add ledger/sampling.py to classify greedy vs. stochastic sampling kernels,
  detect lm_head + logits-sized DtoH host-fallback sampling, compare sampling
  modes across captures, and audit Sibyl deployment profile sampling_policy.
- Wire sampling diagnostics and ## Sampling into ledger analyze (and ensure
  zero-ms Findings notes render even when no >0.5 ms timing finding exists).
- Flag greedy vs. stochastic or temperature mismatches in ledger diff.
- Add --profile and --fail-on-sampling to ledger sibyl-audit to catch
  sampling_default_temperature=0 / sampling_thinking_temperature=0 and
  profile-vs-kernel mismatches.
- Add --temperature / --top-p flags and run.json recording to ledger profile,
  examples/vllm_decode.py, and ledger ascend-import.
- Add tests/test_sampling.py covering all diagnostic paths.
@0Chencc
0Chencc merged commit 1f580bf into main Dec 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant