[Engine] hy4 CUDA/HIP serve always reports draft_n 0

Open Beginner friendly
#7,211 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Read engine/src/hy4flash/run/hy4_serve.hip.h, where the CUDA/HIP serve path formats the DONE response, and compare its counters with sy_serve.h or hy4_metal_serve.h, which the issue says already pass request counts. Trace which counters are offered and accepted for the request, then confirm the API timings report them instead of zero while the engine log remains consistent.

Written by the indexing model from the issue text.

Description

Title: [Engine] hy4 CUDA serve reports draft_n 0 while DFly2 accepts drafts

Area: [Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source? Docker

Reproduction status: Reproduced locally

Strata version: Strata 0.2.18 (build 0.1.64) · strata-hy4 0.1.67 · image ghcr.io/niko1221/strata:0.2.18-cuda13

Graphics card, memory and system: RTX 5090 Laptop GPU 24 GB · driver 595.84 · 94 GB RAM · Ubuntu 24.04.3 · kernel 6.14.0-35-generic

Model, size and settings: Hy4-Flash SQ-64 · 131072 context · vision on · --draft dfly2 · --vram-experts-gb 9.25 · --ram-experts-gb 46.79

What happened

Non-streaming POST /v1/chat/completions on hy4-flash-sq-64 returns
timings.draft_n = 0 and timings.draft_n_accepted = 0 while the engine log
shows DFly2 accepting drafts for that same generation.

First request after this SQ-64 process started:

Response timings:
predicted_n 32, predicted_ms 1319.4, predicted_per_second 24.3,
draft_n 0, draft_n_accepted 0

engine.log for that request:
[spec] K=7 adaptive tree=1 early=0.04: 32 tokens in 14 iterations (12 spec + 2 plain), 2.29 tokens/iteration, total 1319 ms
[spec] verify steps 12: accepted drafts per step 1.417 (verified slots 3.17/step, tree_steps 2, branch_hits 1, prob_iters 0, chain_evals 84, early_exits 1), draft 3.9 ms/step, verify 92.0 ms/step

The [spec] counters in this log are cumulative for the process. The last
request added 128 generated tokens (3253 -> 3381) and 23 verify steps
(734 -> 757); the accepted-draft histogram for that step rose by about 106.
The API timings for these requests stayed at 0.

Expected: draft_n and draft_n_accepted match the drafts this request offered
and accepted. server.py _parse_done copies DONE fields 7 and 8 into
drafts_accepted and drafts_offered.

On main (read 2026-11-26), the CUDA/HIP serve path writes both fields as
literal zeros and still prints the real counts to stderr:

engine/src/hy4flash/run/hy4_serve.hip.h
  proto("DONE %d %d %.1f %.1f %s 0 0 %d", made, T0, prompt_ms, decode_ms, finish, start);
  spec->report(stderr, ...);

sy_serve.h and hy4_metal_serve.h already pass this request's counters.

Related, not the same bug: #5890 fixed this symptom for Qwen --batch-mtp
in 0.2.17. hy4_serve.hip.h still emits the zeros. This run is strata-hy4 0.1.67.

Smallest steps

1. Run strata-hy4 0.1.67 with --draft dfly2 on Hy4-Flash SQ-64.
2. POST /v1/chat/completions, stream false, max_tokens 32 or 128.
3. Compare timings.draft_n / draft_n_accepted with the [spec] block appended to engine.log for that request.

Logs

strata --version
strata 0.2.18 (build 0.1.64; python 3.12.15)

Engine command:
strata-hy4 --serve --native Hy4-Flash-SQ-64.strata --engram Hy4-Flash-Engram-Q8.strata --max-context 131072 --vision Hy4-Flash-Vision.strata --vram-experts-gb 9.25 --ram-experts-gb 46.79 --draft dfly2

[spec] K=7 adaptive tree=1 early=0.04: 32 tokens in 14 iterations (12 spec + 2 plain), 2.29 tokens/iteration, total 1319 ms
[spec] verify steps 12: accepted drafts per step 1.417 (verified slots 3.17/step, tree_steps 2, branch_hits 1, prob_iters 0, chain_evals 84, early_exits 1), draft 3.9 ms/step, verify 92.0 ms/step
Dominant language
C++
Stars
11.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Niko1221/Strata

All issues in Niko1221/Strata

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.