[GH-ISSUE #4047] [Engine] Replica ports: each card its own server, one shared expert arena (the supervisor piece of #127) #1751

Closed
opened 2026-11-04 01:53:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @furkangkhsn on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4047

Area

Engine

What do you want to do?

#127 described independent lanes: one engine per GPU, one shared host expert arena, nothing synchronized between the cards. #129 brought the arena primitive (--shared-expert-arena). In #127 you mentioned the remaining piece as "a small request router in the server". I'd like to propose that piece in a form that needs no routing at all.

My PC: RTX 3090 24 GB + RTX 4070 Ti 12 GB, 91 GB RAM, Qwen3.8-Flash-Next IQ3_XXS.

  • Today I run one serve/server.py per card by hand: 8080 on the 3090 with a 524K context, 8081 on the 4070 Ti with 128K.
  • Both use --shared-expert-arena on the same ~43 GB file. Two copies would not fit in 91 GB.
  • An agent harness sends the main session to 8080 and sub-agents to 8081, so both decode at the same time (about 81 + 59 tok/s).
  • replicas almost covers this, but it puts every engine behind one routed address with its own arena.

Proposal, opt-in, as an extension of replicas:

  • When every replicas entry has a "port", each replica is its own ordinary Strata server on that port: its own context, /health, /v1/models, API monitor and conversation cache.
    • The client picks the port, so there is no router.
    • If an engine dies, that port's server restarts it, as a single server does today.
  • "replica_shared_arena": "<file>" (and --replica-shared-arena) adds --shared-expert-arena <file> to every replica.
    • The replicas start one after another: the first fills the file, the next ones attach.
    • The file is deleted at stop.
  • The process you start only supervises:
    • It starts the per-port servers with their cards and their own cores (cpu_sets).
    • It forwards Ctrl+C / SIGTERM and stops them when it stops.
    • On Linux they end with it if it is killed (lifeline).
  • These configs refuse the start: some entries with a port and some without, a port used twice, a port already in use, or --lazy. Without ports, replicas is unchanged.
"gpu": [0, 1],
"replicas": [{"gpus": [0], "port": 8080, "args": ["--max-context", "524288"]},
             {"gpus": [1], "port": 8081, "args": ["--max-context", "131072"]}],
"replica_shared_arena": "/tmp/strata.arena"

Tradeoffs:

  • No balancing between ports: that is the point, a request on 8081 never lands on the 3090.
  • One crash stops all ports: a replica server that exits by itself stops the others too; I chose the simple behaviour.
  • The arena is rewritten on each start: the engine is unchanged, so a later replica rewrites the same arena bytes it attaches to (harmless).
  • Linux-only arena: the arena itself is Linux-only, as in #129.

The branch is ready: a supervisor in serve/replicas.py and a short branch in main(), with no Service or engine change and tests with the mock engine. I'm opening it as a draft PR and will mark it ready if this scope is fine for you.

What do you do today instead?

Two hand-written run configs pointing --shared-expert-arena at the same file, two servers started one after another by my own script under systemd, and manual cleanup of the arena file.

Originally created by @furkangkhsn on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4047 ### Area Engine ### What do you want to do? #127 described independent lanes: one engine per GPU, one shared host expert arena, nothing synchronized between the cards. #129 brought the arena primitive (`--shared-expert-arena`). In #127 you mentioned the remaining piece as "a small request router in the server". I'd like to propose that piece in a form that needs no routing at all. My PC: RTX 3090 24 GB + RTX 4070 Ti 12 GB, 91 GB RAM, Qwen3.8-Flash-Next IQ3_XXS. - Today I run one `serve/server.py` per card by hand: 8080 on the 3090 with a 524K context, 8081 on the 4070 Ti with 128K. - Both use `--shared-expert-arena` on the same ~43 GB file. Two copies would not fit in 91 GB. - An agent harness sends the main session to 8080 and sub-agents to 8081, so both decode at the same time (about 81 + 59 tok/s). - `replicas` almost covers this, but it puts every engine behind one routed address with its own arena. Proposal, opt-in, as an extension of `replicas`: - When **every** `replicas` entry has a `"port"`, each replica is its own ordinary Strata server on that port: its own context, `/health`, `/v1/models`, API monitor and conversation cache. - The client picks the port, so there is no router. - If an engine dies, that port's server restarts it, as a single server does today. - `"replica_shared_arena": "<file>"` (and `--replica-shared-arena`) adds `--shared-expert-arena <file>` to every replica. - The replicas start one after another: the first fills the file, the next ones attach. - The file is deleted at stop. - The process you start only supervises: - It starts the per-port servers with their cards and their own cores (`cpu_sets`). - It forwards Ctrl+C / SIGTERM and stops them when it stops. - On Linux they end with it if it is killed (lifeline). - These configs refuse the start: some entries with a port and some without, a port used twice, a port already in use, or `--lazy`. Without ports, `replicas` is unchanged. ```json "gpu": [0, 1], "replicas": [{"gpus": [0], "port": 8080, "args": ["--max-context", "524288"]}, {"gpus": [1], "port": 8081, "args": ["--max-context", "131072"]}], "replica_shared_arena": "/tmp/strata.arena" ``` Tradeoffs: - **No balancing between ports:** that is the point, a request on 8081 never lands on the 3090. - **One crash stops all ports:** a replica server that exits by itself stops the others too; I chose the simple behaviour. - **The arena is rewritten on each start:** the engine is unchanged, so a later replica rewrites the same arena bytes it attaches to (harmless). - **Linux-only arena:** the arena itself is Linux-only, as in #129. The branch is ready: a supervisor in `serve/replicas.py` and a short branch in `main()`, with no `Service` or engine change and tests with the mock engine. I'm opening it as a draft PR and will mark it ready if this scope is fine for you. ### What do you do today instead? Two hand-written run configs pointing `--shared-expert-arena` at the same file, two servers started one after another by my own script under systemd, and manual cleanup of the arena file.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6659899913 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1751
No description provided.