[PR #5026] [Engine] report the total expert count (experts=N) in INFO/VRAM telemetry #5289

Open
opened 2026-11-07 16:34:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5026
Author: @yu-chen-Yang
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix-expert-count-telemetry


📝 Commits (1)

  • a7d2e6b [Engine] report the total expert count (experts=N) in INFO/VRAM telemetry

📊 Changes

4 files changed (+13 additions, -7 deletions)

View changed files

📝 serve/test_vram.py (+2 -1)
📝 src/dsv41/ds4_model.cu (+3 -2)
📝 src/program/generate.cpp (+4 -2)
📝 sycl/src/program/generate.cpp (+4 -2)

📄 Description

Summary

  • Fixes #5012: the Monitor tab shows "experts in VRAM / total experts", but no engine ever printed the total — only expert_slots (how many are resident). The total always fell back to 0, so the GUI showed nothing for any model, including Qwen3.6-35B-A3B (qwen35moe/qwen36).
  • Adds experts=N (the model's per-layer expert count: g.n_expert for the generic engine, g.n_exp for the DeepSeek/ds4 engine) next to expert_slots in the INFO and VRAM telemetry lines.
  • Additive only: existing readers of these key=value lines (serve/server.py's generic INFO /VRAM parser) ignore keys they don't recognize, so no other behavior changes.

Approach

Touched:

  • src/program/generate.cpp (CUDA) — INFO and VRAM printf lines
  • sycl/src/program/generate.cpp (SYCL) — same two lines, mirrored
  • src/dsv41/ds4_model.cu (DeepSeek/ds4 engine) — INFO line
  • serve/test_vram.py — extended the existing VRAM-line test with an experts= assertion

HIP path has no engine printf for this at all (nothing to change there).

Test plan

  • python -m unittest serve.test_vram -v — passes, including the new experts=256 assertion
  • Full python -m unittest discover -s serve -p "test_*.py" — 1298 tests, only 1 failure, in test_lifeline.py (a pre-existing filesystem-timing flake unrelated to this change, not touching any file this PR modifies)
  • CUDA build: cmake --build build --target strata — compiles and links clean against the modified generate.cpp / ds4_model.cu
  • SYCL build — not run (no Intel oneAPI toolchain available in this environment); the SYCL edit mirrors the CUDA one line-for-line against the same struct fields (g.n_expert, same types)
  • Not exercised against a loaded model/GPU (no pack available in this environment) — the new field is a straight printf addition next to fields already covered by test_vram.py's parsing test

🔄 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/5026 **Author:** [@yu-chen-Yang](https://github.com/yu-chen-Yang) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-expert-count-telemetry` --- ### 📝 Commits (1) - [`a7d2e6b`](https://github.com/Niko1221/Strata/commit/a7d2e6bc5504d2e57a3cf2d586452cdd2b9eb629) [Engine] report the total expert count (experts=N) in INFO/VRAM telemetry ### 📊 Changes **4 files changed** (+13 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `serve/test_vram.py` (+2 -1) 📝 `src/dsv41/ds4_model.cu` (+3 -2) 📝 `src/program/generate.cpp` (+4 -2) 📝 `sycl/src/program/generate.cpp` (+4 -2) </details> ### 📄 Description ## Summary - Fixes #5012: the Monitor tab shows "experts in VRAM / total experts", but no engine ever printed the total — only `expert_slots` (how many are resident). The total always fell back to 0, so the GUI showed nothing for any model, including Qwen3.6-35B-A3B (qwen35moe/qwen36). - Adds `experts=N` (the model's per-layer expert count: `g.n_expert` for the generic engine, `g.n_exp` for the DeepSeek/ds4 engine) next to `expert_slots` in the INFO and VRAM telemetry lines. - Additive only: existing readers of these key=value lines (`serve/server.py`'s generic `INFO `/`VRAM ` parser) ignore keys they don't recognize, so no other behavior changes. ## Approach Touched: - `src/program/generate.cpp` (CUDA) — INFO and VRAM printf lines - `sycl/src/program/generate.cpp` (SYCL) — same two lines, mirrored - `src/dsv41/ds4_model.cu` (DeepSeek/ds4 engine) — INFO line - `serve/test_vram.py` — extended the existing VRAM-line test with an `experts=` assertion HIP path has no engine printf for this at all (nothing to change there). ## Test plan - [x] `python -m unittest serve.test_vram -v` — passes, including the new `experts=256` assertion - [x] Full `python -m unittest discover -s serve -p "test_*.py"` — 1298 tests, only 1 failure, in `test_lifeline.py` (a pre-existing filesystem-timing flake unrelated to this change, not touching any file this PR modifies) - [x] CUDA build: `cmake --build build --target strata` — compiles and links clean against the modified `generate.cpp` / `ds4_model.cu` - [ ] SYCL build — not run (no Intel oneAPI toolchain available in this environment); the SYCL edit mirrors the CUDA one line-for-line against the same struct fields (`g.n_expert`, same types) - [ ] Not exercised against a loaded model/GPU (no pack available in this environment) — the new field is a straight printf addition next to fields already covered by `test_vram.py`'s parsing test --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5289
No description provided.