[PR #2480] [CLOSED] [Engine] send the stream role with the first response data #4064

Closed
opened 2026-11-07 15:32:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2480
Author: @KeyanHu-git
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/2391-stream-first-data


📝 Commits (3)

  • 9c3629f serve: send the role chunk with the first response data
  • b7766a3 test: cover progress and MCP stream opening
  • 48ca8f9 merge current main and align stream tests with declared tools

📊 Changes

2 files changed (+170 additions, -1 deletions)

View changed files

📝 serve/server.py (+21 -1)
➕ serve/test_first_chunk.py (+149 -0)

📄 Description

Problem and result

Withdrawn after checking the measurement path on Strata 0.2.2 (011c9e60). This patch delays the role-only stream chunk, but the reported prefill discrepancy comes from estimating processing time using the arrival of that chunk. I have not established a server-side requirement for changing its timing.

#2391 reports implausible prefill throughput in llama-benchy while first-content latency and Strata's monitor show normal processing time.

Approach

In llama-benchy's metric calculation, per-request prefill throughput uses first_response_ts - start_ts - latency. Its client records a role-only chunk as the first response and records the first content separately. Strata's own tools/strata_bench.py already waits for nonempty content or reasoning when measuring first-token latency.

Validation

Passed: replayed fixed timestamps through the unchanged llama-benchy metric methods. With 8,192 input tokens and first content fixed at 3.650 seconds, moving only the role chunk from 7 ms to 3.650 seconds changes the per-request prefill estimate from 1,365,333 to 2,245 tok/s. The content-based batch metric remains 2,244.38 tok/s in both cases.

Failed: none in this metric replay.

Not run: a new model-speed benchmark; the replay isolates the metric and does not measure inference speed.

Limits

The earlier stream-ordering tests show that the patch delays the role chunk. They do not establish that the original timing is a server defect. The measurement definition should be resolved before proposing a server compatibility change.


🔄 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/Niko1221/Strata/pull/2480 **Author:** [@KeyanHu-git](https://github.com/KeyanHu-git) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/2391-stream-first-data` --- ### 📝 Commits (3) - [`9c3629f`](https://github.com/Niko1221/Strata/commit/9c3629f8e5695596a82ba6ee9d60ad8e8b6b3e3a) serve: send the role chunk with the first response data - [`b7766a3`](https://github.com/Niko1221/Strata/commit/b7766a34fd27659bfbcee8798afab836ff6c9cd9) test: cover progress and MCP stream opening - [`48ca8f9`](https://github.com/Niko1221/Strata/commit/48ca8f9c6338dac9ee174aae0627e66f359c4d9a) merge current main and align stream tests with declared tools ### 📊 Changes **2 files changed** (+170 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+21 -1) ➕ `serve/test_first_chunk.py` (+149 -0) </details> ### 📄 Description ## Problem and result Withdrawn after checking the measurement path on Strata 0.2.2 (`011c9e60`). This patch delays the role-only stream chunk, but the reported prefill discrepancy comes from estimating processing time using the arrival of that chunk. I have not established a server-side requirement for changing its timing. ## Related discussion #2391 reports implausible prefill throughput in llama-benchy while first-content latency and Strata's monitor show normal processing time. ## Approach In [llama-benchy's metric calculation](https://github.com/eugr/llama-benchy/blob/e9be344578cec17745066b220798b80a0d2686d3/src/llama_benchy/results.py#L295-L315), per-request prefill throughput uses `first_response_ts - start_ts - latency`. Its client records a role-only chunk as the first response and records the first content separately. Strata's own `tools/strata_bench.py` already waits for nonempty content or reasoning when measuring first-token latency. ## Validation **Passed:** replayed fixed timestamps through the unchanged llama-benchy metric methods. With 8,192 input tokens and first content fixed at 3.650 seconds, moving only the role chunk from 7 ms to 3.650 seconds changes the per-request prefill estimate from 1,365,333 to 2,245 tok/s. The content-based batch metric remains 2,244.38 tok/s in both cases. **Failed:** none in this metric replay. **Not run:** a new model-speed benchmark; the replay isolates the metric and does not measure inference speed. ## Limits The earlier stream-ordering tests show that the patch delays the role chunk. They do not establish that the original timing is a server defect. The measurement definition should be resolved before proposing a server compatibility change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:55 +07:00
Sign in to join this conversation.
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
Niko1221/Strata#4064
No description provided.