[GH-ISSUE #6717] [Issue]: Decision sidecar's first answer after each start is slow, so Test shows warm-up time instead of its real speed #3764

Closed
opened 2026-10-21 06:06:57 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Sep 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6717

Originally assigned to: @kolacheee on GitHub.

The decision sidecar's first answer after it starts is slow, and every answer after that is fast. The Test button is usually that first request, so it reports the warm-up time. A user who clicks Test once reads "2 seconds" as the model's normal speed.

How to reproduce (try it yourself)

  1. Select Decision sidecar — Open-Jev 2B as the Decision model.
  2. Restart Marinara, or turn the sidecar off and on, so the model starts fresh.
  3. Click Test, then click it again.

What you'll see: the first result is about 1.4 to 2.3 seconds ("Answered 0.910 in 2279 ms"), the second about 0.09 seconds ("Answered 0.910 in 87 ms").

What should happen: the first Test shows the model's normal speed.

Measured on staging 77d4b0e57, RTX 5090 Laptop:

First request after a start Later requests
Engine Test 1371 ms 87 ms, 89 ms
Direct to the model server, two separate starts 1531 ms, 1482 ms about 90 ms

The model server's own inference_seconds matches the first number, so the time is spent inside the model, not in HTTP. It happens on every start, whichever start policy is chosen. Test's reported time never includes the process start, only the request.

Where it is

packages/server/src/services/sidecar/decision-process.service.ts, start(): the address is published as soon as the server prints its {"url": ...} line, and nothing asks it a question first.

What's happening

The first inference after loading pays a one-time GPU setup cost. Nothing pays it before the first real question, so the first gate or Test after each start does.

Suggested fix

In start(), after the URL line and before the address is published, send one small question shaped like Test's. Callers already wait on the load, so the first gate and Test then see the normal speed. A failed warm-up should not fail the start, and a stop during it should still cancel the start.

Context

Reported by a user. Staging only (#6556). Investigated with an AI agent; verify before fixing.

Originally created by @kolacheee on GitHub (Sep 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6717 Originally assigned to: @kolacheee on GitHub. The decision sidecar's first answer after it starts is slow, and every answer after that is fast. The **Test** button is usually that first request, so it reports the warm-up time. A user who clicks Test once reads "2 seconds" as the model's normal speed. ## How to reproduce (try it yourself) 1. Select **Decision sidecar — Open-Jev 2B** as the **Decision model**. 2. Restart Marinara, or turn the sidecar off and on, so the model starts fresh. 3. Click **Test**, then click it again. **What you'll see:** the first result is about 1.4 to 2.3 seconds ("Answered 0.910 in 2279 ms"), the second about 0.09 seconds ("Answered 0.910 in 87 ms"). **What should happen:** the first Test shows the model's normal speed. Measured on staging `77d4b0e57`, RTX 5090 Laptop: | | First request after a start | Later requests | | --- | --- | --- | | Engine Test | 1371 ms | 87 ms, 89 ms | | Direct to the model server, two separate starts | 1531 ms, 1482 ms | about 90 ms | The model server's own `inference_seconds` matches the first number, so the time is spent inside the model, not in HTTP. It happens on every start, whichever start policy is chosen. Test's reported time never includes the process start, only the request. ## Where it is `packages/server/src/services/sidecar/decision-process.service.ts`, `start()`: the address is published as soon as the server prints its `{"url": ...}` line, and nothing asks it a question first. ## What's happening The first inference after loading pays a one-time GPU setup cost. Nothing pays it before the first real question, so the first gate or Test after each start does. ## Suggested fix In `start()`, after the URL line and before the address is published, send one small question shaped like Test's. Callers already wait on the load, so the first gate and Test then see the normal speed. A failed warm-up should not fail the start, and a stop during it should still cancel the start. ## Context Reported by a user. Staging only (#6556). Investigated with an AI agent; verify before fixing.
bsakaguchi 2026-10-21 06:06:57 +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
Pasta-Devs/Marinara-Engine#3764
No description provided.