[PR #380] [MERGED] maya-ds4: DS4_PROF's decode line for each served request too #499

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/380
Author: @pepuscz
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @mw00

Base: main ← Head: pr/ds4-prof-serve


📝 Commits (1)

  • 2160a4c maya-ds4: DS4_PROF's decode line for each served request too

📊 Changes

1 file changed (+17 additions, -10 deletions)

View changed files

📝 src/ds4/ds4_main.cpp (+17 -10)

📄 Description

What. DS4_PROF's per-token stage times are:

  • between layers;
  • attention;
  • routing + shared expert;
  • experts gate/up;
  • the CPU lane's wait;
  • down + post.

Until now they were printed only at the end of a CLI run. The serve loop, which the server and every HTTP client use, collected the events but never printed them. A helper now prints the line between two stats snapshots:

  • the CLI run prints it as before;
  • in serve, each request prints one line for its decode, with the number of profiled tokens appended so a caller can check it.

Changes. src/ds4/ds4_main.cpp (+17/-10). Nothing changes without DS4_PROF.

Verified.

  • Served with DS4_PROF=1 (setup below): each of the two requests printed exactly one line on stderr, none at load, with 63 profiled tokens for a 64-token answer (the first token comes from the prefill):
    GPU per token (DS4_PROF): 79.62 ms - between layers 0.16, attention 14.52, routing + shared expert 6.65, experts gate/up 1.62, waiting for the CPU lane 54.64, down + post 2.04; 63 tokens
    
  • The line goes to stderr; the serve protocol on stdout is unchanged.
  • The figures are one request's stage sums in this diagnostic setup, for seeing where the time goes, not speeds.

Test setup. The four commits of this series stacked on v1.1.22 (pr/quickcheck-v1122, 53cefbb); this PR is the same change on plain v1.1.22. HIP build (ROCm 7.2.4, gfx1100;gfx1151), 2x RX 7900 XTX (gfx1100), DeepSeek-V4.1-Flash-1017 Maya-S. Two fresh server loads, layer split over both cards (--tp 1), --no-expert-cache, --dspark none, 128K context. Each served one 2,040-token prompt of the public context-scaling retrieval workload (five planted values; definition and data in benchmarks/results.json, method in docs/BENCHMARKS.md) and wrote 64 tokens, greedy, thinking off. One load had MAYA_DS4_Q8_BATCH=1 and the other didn't; both had MAYA_DS4_Q8_CHECK=1, DS4_PROF=1 and MAYA_DS4_LT_STORE pointing at a new empty file. This is a smoke test of the changed paths (one request each), not a speed or quality qualification.

🤖 Generated with Claude Code


🔄 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/380 **Author:** [@pepuscz](https://github.com/pepuscz) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `pr/ds4-prof-serve` --- ### 📝 Commits (1) - [`2160a4c`](https://github.com/mw00/project-maya/commit/2160a4c875c926ebf8feced1fc94c2594853b8cc) maya-ds4: DS4_PROF's decode line for each served request too ### 📊 Changes **1 file changed** (+17 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/ds4/ds4_main.cpp` (+17 -10) </details> ### 📄 Description **What.** `DS4_PROF`'s per-token stage times are: - between layers; - attention; - routing + shared expert; - experts gate/up; - the CPU lane's wait; - down + post. Until now they were printed only at the end of a CLI run. The serve loop, which the server and every HTTP client use, collected the events but never printed them. A helper now prints the line between two stats snapshots: - the CLI run prints it as before; - in serve, each request prints one line for its decode, with the number of profiled tokens appended so a caller can check it. **Changes.** `src/ds4/ds4_main.cpp` (+17/-10). Nothing changes without `DS4_PROF`. **Verified.** - Served with `DS4_PROF=1` (setup below): each of the two requests printed exactly one line on stderr, none at load, with 63 profiled tokens for a 64-token answer (the first token comes from the prefill): ``` GPU per token (DS4_PROF): 79.62 ms - between layers 0.16, attention 14.52, routing + shared expert 6.65, experts gate/up 1.62, waiting for the CPU lane 54.64, down + post 2.04; 63 tokens ``` - The line goes to stderr; the serve protocol on stdout is unchanged. - The figures are one request's stage sums in this diagnostic setup, for seeing where the time goes, not speeds. **Test setup.** The four commits of this series stacked on v1.1.22 ([`pr/quickcheck-v1122`](https://github.com/pepuscz/project-maya/tree/pr/quickcheck-v1122), 53cefbb); this PR is the same change on plain v1.1.22. HIP build (ROCm 7.2.4, `gfx1100;gfx1151`), 2x RX 7900 XTX (gfx1100), DeepSeek-V4.1-Flash-1017 Maya-S. Two fresh server loads, layer split over both cards (`--tp 1`), `--no-expert-cache`, `--dspark none`, 128K context. Each served one 2,040-token prompt of the public context-scaling retrieval workload (five planted values; definition and data in [`benchmarks/results.json`](https://github.com/pepuscz/strix-halo-llm/blob/56541b2/benchmarks/results.json), method in [`docs/BENCHMARKS.md`](https://github.com/pepuscz/strix-halo-llm/blob/56541b2/docs/BENCHMARKS.md)) and wrote 64 tokens, greedy, thinking off. One load had `MAYA_DS4_Q8_BATCH=1` and the other didn't; both had `MAYA_DS4_Q8_CHECK=1`, `DS4_PROF=1` and `MAYA_DS4_LT_STORE` pointing at a new empty file. This is a smoke test of the changed paths (one request each), not a speed or quality qualification. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:26:06 +07:00
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#499
No description provided.