[PR #647] ds4: expose drafter and verification timing in serving metrics #649

Open
opened 2026-10-29 21:27:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/647
Author: @LostVector
Created: 10/29/2026
Status: 🔄 Open

Base: main ← Head: upstream/ds4-draft-timing


📝 Commits (1)

  • 2898c76 ds4: expose existing draft and verification timers in serving metrics

📊 Changes

4 files changed (+26 additions, -0 deletions)

View changed files

➕ docs/ds4-draft-timing.md (+13 -0)
📝 serve/server.py (+3 -0)
📝 serve/test_server.py (+4 -0)
📝 src/ds4/ds4_main.cpp (+6 -0)

📄 Description

Better draft acceptance does not tell us whether drafting saves time. In our earlier 16K-context agent comparison, sampled proposals raised acceptance from 75.6% to 80.8%, while decode only rose from 32.68 to 33.48 tok/s (+2.4%). This adds the existing drafter and verification timers to live serving statistics so users can see the cost behind the acceptance number.

STAT now includes draft_rounds, draft_ms, and verify_ms; the server also exports them as Prometheus gauges. The measurements cover the request's decode in serial serving, or the engine's busy interval across requests with --parallel. The documentation explains that these are existing host-timed regions, not GPU-only measurements or a complete wall-time breakdown. Batched draft rounds count each requesting sequence.

The implementation reads existing counters at reporting time. It adds no device synchronization and changes no sampling or model arithmetic. It does not add sampled drafting: upstream already supports DS4_DSPARK_SAMPLE=1.

Historical motivation: three fixtures, two seeds and four balanced independent loads, normal adaptive caching, three R9700s, 3.5 bpw EXL3, DSpark enabled. Async-code throughput was 2.7% lower with sampled proposals; short-code results had substantial control drift. These are workload-dependent observations from our older serving build, not current-base speed claims.

Validation on v1.1.36 (f031a23):

  • HIP host translation unit compiled; HIP compatibility check passes.
  • Server API module: 116 tests pass, including the extended Prometheus value/type checks.
  • Full server discovery: 464 tests; the Python 3.12 run failed only in the structured-output module because jsonschema was missing. After supplying the CI dependency in an isolated directory, that module's 9 tests pass (1 skipped). The other server modules passed the full run.
  • Installer/tools: 585 tests pass (31 skipped), with the CI-pinned gguf-py dependency.

No linked current-base engine or full-model run is claimed by this diagnostics-only draft.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/647 **Author:** [@LostVector](https://github.com/LostVector) **Created:** 10/29/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `upstream/ds4-draft-timing` --- ### 📝 Commits (1) - [`2898c76`](https://github.com/mw00/project-maya/commit/2898c7681b5d455ba0dfb5d7d1316b677e97f594) ds4: expose existing draft and verification timers in serving metrics ### 📊 Changes **4 files changed** (+26 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/ds4-draft-timing.md` (+13 -0) 📝 `serve/server.py` (+3 -0) 📝 `serve/test_server.py` (+4 -0) 📝 `src/ds4/ds4_main.cpp` (+6 -0) </details> ### 📄 Description Better draft acceptance does not tell us whether drafting saves time. In our earlier 16K-context agent comparison, sampled proposals raised acceptance from 75.6% to 80.8%, while decode only rose from 32.68 to 33.48 tok/s (+2.4%). This adds the existing drafter and verification timers to live serving statistics so users can see the cost behind the acceptance number. `STAT` now includes `draft_rounds`, `draft_ms`, and `verify_ms`; the server also exports them as Prometheus gauges. The measurements cover the request's decode in serial serving, or the engine's busy interval across requests with `--parallel`. The documentation explains that these are existing host-timed regions, not GPU-only measurements or a complete wall-time breakdown. Batched draft rounds count each requesting sequence. The implementation reads existing counters at reporting time. It adds no device synchronization and changes no sampling or model arithmetic. It does not add sampled drafting: upstream already supports `DS4_DSPARK_SAMPLE=1`. Historical motivation: three fixtures, two seeds and four balanced independent loads, normal adaptive caching, three R9700s, 3.5 bpw EXL3, DSpark enabled. Async-code throughput was 2.7% lower with sampled proposals; short-code results had substantial control drift. These are workload-dependent observations from our older serving build, not current-base speed claims. Validation on v1.1.36 (`f031a23`): - HIP host translation unit compiled; HIP compatibility check passes. - Server API module: 116 tests pass, including the extended Prometheus value/type checks. - Full server discovery: 464 tests; the Python 3.12 run failed only in the structured-output module because `jsonschema` was missing. After supplying the CI dependency in an isolated directory, that module's 9 tests pass (1 skipped). The other server modules passed the full run. - Installer/tools: 585 tests pass (31 skipped), with the CI-pinned `gguf-py` dependency. No linked current-base engine or full-model run is claimed by this diagnostics-only draft. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#649
No description provided.