[PR #293] [CLOSED] Use chunked DeepSeek prompt defaults on Linux HIP when TP cannot engage #452

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/293
Author: @boxwrench
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: hip/ds4-prompt-route


📝 Commits (2)

  • a2cfb76 setup: enable chunked DeepSeek prompts on Linux HIP without TP
  • 5dffb36 setup: compute the HIP DeepSeek pairing inside the HIP branch; tests

📊 Changes

2 files changed (+50 additions, -0 deletions)

View changed files

📝 maya.py (+10 -0)
📝 tools/test_setup_ds4.py (+40 -0)

📄 Description

DeepSeek setup writes --tp 2, but TP is reduced to 1 for Maya-S's IQ2_XXS experts: FFN width 2304 cannot split into two 256-value blocks. Without --threads on, par = o.threads || tp > 1 is false and prompts use 16-token windows. A single GPU and GPUs without an equal-memory pair likewise cannot form a TP pair.

This changes Linux HIP setup defaults only: --threads on --prefill-chunk 8192 for Maya-S or a selected device list without an equal-memory pair. Saved --threads and --prefill-chunk values still win, including an explicit off. Existing configs take these defaults when setup is rerun unless they already specify overrides. There is no engine/kernel change. Python uses the HIP backend condition; there is no new C++ code needing STRATA_USE_HIP.

Measured on Ryzen AI Max+ 395 / Radeon 8060S (gfx1151), 128 GB unified RAM, Linux, ROCm 7.2.2, v1.1.16, Maya-S, 8192 prompt tokens, 128 generated tokens, greedy, DSpark none:

Route Profile condition 8K TTFT seconds Prompt tok/s Decode tok/s
TP2 requested → TP1, threads off initial profile 742.75 11.0 12.98
same window route learned profile 230.19 35.6 12.76
TP1, threads on, chunk 8192 learned/evolving profile 72.48 113.0 14.25

These are screening runs, not a controlled default confirmation: the profile is read at start and rewritten at exit, and the first two rows differ by 3.2× despite identical flags. A fixed-profile same-config timing floor and paired confirmation remain to do. Do not attribute the full 10.2× cold-to-chunked ratio to batching alone. gfx1201 (Radeon AI PRO R9700) results will follow in a comment.

Raw token logs show the entire 128-token answer after the 8K prompt is identical between the initial window run and chunked run. The separate one-token answer to an 8-token probe differs (5523 vs 2808). This is scoped 8K parity, not general parity or an independent quality evaluation.

Why setup rather than engine fallback: a backend-scoped setup default preserves direct-engine users' explicit thread choice, CUDA configuration, and CUDA numerical behavior. CUDA single-GPU users may have the same route problem, but changing their default needs their own greedy-token check. Leave CUDA untouched here.

Validation done locally: upstream's Python CI steps in a fresh venv (tools tests 315 OK incl. five new test_setup_ds4 cases: one HIP GPU chunks prompts, an equal HIP pair keeps TP, Maya-S on a pair chunks prompts, a saved --threads off is kept, CUDA args unchanged; server tests; check_hip_compat). The first push read vram_gb before the HIP check and broke the CUDA fixtures; fixed in the second commit. No GPU run in preparing this patch.

Maintainer test plan:

  • Compare baseline/patched generated CUDA configs and greedy token-id md5 with the usual CUDA 12 / 2×V100 / GNU ld setup; same model, prompts and flags, placement/profile copied independently for each arm. Include one GPU and a TP-compatible pair. Configs and md5 must remain unchanged.
  • Separately opt into --threads on --prefill-chunk 8192 on CUDA to assess a possible CUDA follow-up. Test short (<512), 2K, 8K and multi-chunk prompts, at least 256 output tokens, both prose/code, no prefix reuse, fixed DSpark/vision/context/residency and immutable profile copies. Repeat the control to establish the timing and identity floor; compare canonical token-id md5, not rendered text.
  • Confirm the same matrix on gfx1151 and gfx1201 before treating the HIP default as confirmed; investigate the short-probe mismatch. Ensure setup preserves saved overrides. No archive link order changed (strata_engine remains before strata_prefill).

🔄 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/293 **Author:** [@boxwrench](https://github.com/boxwrench) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `hip/ds4-prompt-route` --- ### 📝 Commits (2) - [`a2cfb76`](https://github.com/mw00/project-maya/commit/a2cfb768c69c6dc03f9a7b4cf399cf7ff550ede9) setup: enable chunked DeepSeek prompts on Linux HIP without TP - [`5dffb36`](https://github.com/mw00/project-maya/commit/5dffb3644345fc2dc2118c500171369fe146b1f3) setup: compute the HIP DeepSeek pairing inside the HIP branch; tests ### 📊 Changes **2 files changed** (+50 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `maya.py` (+10 -0) 📝 `tools/test_setup_ds4.py` (+40 -0) </details> ### 📄 Description DeepSeek setup writes `--tp 2`, but TP is reduced to 1 for Maya-S's IQ2_XXS experts: FFN width 2304 cannot split into two 256-value blocks. Without `--threads on`, `par = o.threads || tp > 1` is false and prompts use 16-token windows. A single GPU and GPUs without an equal-memory pair likewise cannot form a TP pair. This changes Linux HIP setup defaults only: `--threads on --prefill-chunk 8192` for Maya-S or a selected device list without an equal-memory pair. Saved `--threads` and `--prefill-chunk` values still win, including an explicit `off`. Existing configs take these defaults when setup is rerun unless they already specify overrides. There is no engine/kernel change. Python uses the HIP backend condition; there is no new C++ code needing `STRATA_USE_HIP`. Measured on Ryzen AI Max+ 395 / Radeon 8060S (gfx1151), 128 GB unified RAM, Linux, ROCm 7.2.2, v1.1.16, Maya-S, 8192 prompt tokens, 128 generated tokens, greedy, DSpark none: | Route | Profile condition | 8K TTFT seconds | Prompt tok/s | Decode tok/s | |---|---|---:|---:|---:| | TP2 requested → TP1, threads off | initial profile | 742.75 | 11.0 | 12.98 | | same window route | learned profile | 230.19 | 35.6 | 12.76 | | TP1, threads on, chunk 8192 | learned/evolving profile | 72.48 | 113.0 | 14.25 | These are screening runs, not a controlled default confirmation: the profile is read at start and rewritten at exit, and the first two rows differ by 3.2× despite identical flags. A fixed-profile same-config timing floor and paired confirmation remain to do. Do not attribute the full 10.2× cold-to-chunked ratio to batching alone. gfx1201 (Radeon AI PRO R9700) results will follow in a comment. Raw token logs show the entire 128-token answer after the 8K prompt is identical between the initial window run and chunked run. The separate one-token answer to an 8-token probe differs (5523 vs 2808). This is scoped 8K parity, not general parity or an independent quality evaluation. Why setup rather than engine fallback: a backend-scoped setup default preserves direct-engine users' explicit thread choice, CUDA configuration, and CUDA numerical behavior. CUDA single-GPU users may have the same route problem, but changing their default needs their own greedy-token check. Leave CUDA untouched here. Validation done locally: upstream's Python CI steps in a fresh venv (tools tests 315 OK incl. five new `test_setup_ds4` cases: one HIP GPU chunks prompts, an equal HIP pair keeps TP, Maya-S on a pair chunks prompts, a saved `--threads off` is kept, CUDA args unchanged; server tests; `check_hip_compat`). The first push read `vram_gb` before the HIP check and broke the CUDA fixtures; fixed in the second commit. No GPU run in preparing this patch. Maintainer test plan: - Compare baseline/patched generated CUDA configs and greedy token-id md5 with the usual CUDA 12 / 2×V100 / GNU ld setup; same model, prompts and flags, placement/profile copied independently for each arm. Include one GPU and a TP-compatible pair. Configs and md5 must remain unchanged. - Separately opt into `--threads on --prefill-chunk 8192` on CUDA to assess a possible CUDA follow-up. Test short (<512), 2K, 8K and multi-chunk prompts, at least 256 output tokens, both prose/code, no prefix reuse, fixed DSpark/vision/context/residency and immutable profile copies. Repeat the control to establish the timing and identity floor; compare canonical token-id md5, not rendered text. - Confirm the same matrix on gfx1151 and gfx1201 before treating the HIP default as confirmed; investigate the short-probe mismatch. Ensure setup preserves saved overrides. No archive link order changed (`strata_engine` remains before `strata_prefill`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:25:34 +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#452
No description provided.