Skip to content

feat(tts): auto-select NVIDIA acceleration with manual overrides - #177

Merged
Lucas1479 merged 2 commits into
mainfrom
codex/tts-auto-acceleration
Oct 10, 2026
Merged

Lucas1479 merged 2 commits into
mainfrom
codex/tts-auto-acceleration

Conversation

@Lucas1479

Copy link
Copy Markdown
Member

Fresh NVIDIA GPT-SoVITS installations now choose CUDA Graph automatically and use the optional FlashAttention KV-cache extension when the actual speech device, precision and installed extension support it. Both existing switches default to auto; explicit 0/1 overrides remain supported, and the desktop inference-mode control includes Automatic (recommended).

Behavior and compatibility

  • Resolve acceleration after loading/moving speech weights, using the speech runtime rather than host GPU availability. Sidecars report their own existing device/HIP facts to the parent selector.
  • Automatic CUDA Graph is NVIDIA-only. CPU, MPS, ROCm and remote backends do not gain automatic Graph execution; ROCm retains its existing explicit Graph opt-in.
  • FlashAttention selection requires NVIDIA Ampere-or-newer, FP16/BF16 and the optional compatible extension. Missing extensions keep SDPA. No dependency, model or asset requirement changes.
  • Explicit Graph off also prevents startup graph precapture. Live mode changes, prediction, synthesis and warmup consume the runtime's effective choice.
  • Existing saved values take precedence. Both READMEs and .env.example explain recommended auto settings, manual overrides and optional extension installation. Sentence/utterance grouping is unchanged.

Validation

  • Python policy, sidecar, mode, settings and threading suites: 137 passed, 1 skipped.
  • TTS/deadline/selector regression suites: 315 passed.
  • Local T2S/device/static-KV/semantic-guard suites: 37 passed.
  • Electron: 389 tests passed; npm run build passed.
  • Configuration-generation checks, Ruff and git diff --check passed.
  • Windows / Python 3.12.10 / Torch 2.6.0+cu124 / flash_attn 2.7.4.post1 / RTX 4070 Ti SUPER: tools/verify_flash_attention.py --compute --device cuda:0 passed all 8 FP16/BF16 forward and KV-cache comparisons.
  • AMADEUS_RUN_GPU_TESTS=1 python -m pytest tests/test_local_tts_device_context.py -k auto_graph_and_flash_capture_replay -q: passed automatic selection plus combined FlashAttention/Graph capture and replay on a small random-weight T2S model. This is kernel/runtime evidence, not a full speech-quality or latency benchmark.

Related: #176.

@Lucas1479
Lucas1479 merged commit 61e9447 into main Oct 10, 2026
16 checks passed
@Lucas1479
Lucas1479 deleted the codex/tts-auto-acceleration branch October 10, 2026 18:27
Lucas1479 added a commit that referenced this pull request Oct 10, 2026
#178)

## Problem and change

A completed research report could appear in full on its Slice card while
Kurisu only received a short narration. WorkNote/narrator input budgets
discarded the report body, and subsequent Main Chat frames projected
status without the persisted result. Questions about details late in a
report therefore could not be answered from the already completed Work.

- Preserve complete terminal report input through WorkNote, merged
narration and the existing terminal-language repair. Keep progress and
spoken-output budgets.
- Read the latest terminal Attempt result from the Work accepted at the
receiving session/context into `current_work.result`. Retain provider
attribution and Host completion state; do not expose predecessor results
during a newer active or orphaned Attempt. Reuse the existing ledger
after restart.
- Add the requested flexible six-sentence rule to the built-in Japanese
Kurisu persona: normally at most six sentences, with exceptions for
requested detail or an accurate, sufficient answer. The optional
full-persona override stays empty by default and still takes precedence.
- Document the behavior in both READMEs. No database migration, new
setting, new summarization pass, or dependency change.

## Validation

- Relevant regression suites on the combined #177/#178 head `0f51b41`:
**223 passed**. Command: `python -X utf8 -m pytest -q
tests/test_work_terminal_report_context.py
tests/test_main_chat_character_prompt.py
tests/test_character_prompt_snapshots.py
tests/test_character_prompt_module.py
tests/test_cooperative_work_provider_facts.py
tests/test_cooperative_experience.py
tests/test_cooperative_shared_history.py
tests/test_session_character_scope.py
tests/test_work_narration_priority.py
tests/test_work_narration_governor.py
tests/test_work_narration_privacy.py
tests/test_work_observer_role_sanitization.py
tests/test_cooperative_context_recovery.py`.
- `python -m ruff check .` and both architecture/README view checks
passed.
- All 14 GitHub CI checks passed on
`0f51b41377f46585047db25578bcac6696aab9b1`, including all three isolated
Python-suite shards, Electron build, Windows desktop smoke, and
platform/profile checks. Maintainer manual acceptance passed on
2026-10-11 (Pacific/Auckland). The superseded partial local full-suite
run is not counted as a full pass.
- `npm --prefix electron run build` passed in the maintainer local
checkout after synchronizing its pre-existing local voice-catalog
customization into its generated catalog. Those local customization
files are excluded from this PR.
- Live DeepSeek main-model comparison using a synthetic 4.5 KB report,
production persona/frame and transport: without the report it explicitly
lacked the details; with the report it returned the late 722/372 counts
and Lean caveat with `action: null`. No UI/audio run or real-news truth
validation is claimed.
- Regression coverage includes concise speech, terminal repair, bounded
progress, error/cancelled results, session/context isolation,
latest-attempt replacement, archive handling, restart recovery, and the
standalone Provider Slice/narration path.

Related to #176. #177 passed all 16 checks and has since merged; this
branch includes the main update. PR only, per maintainer request.

## 中文说明

终态研究报告在 Slice 卡片中是完整的,但红莉栖此前只收到简短播报;后续主对话也没有读取台账中的报告正文,所以无法回答报告后半段的细节。

本次保留终态报告输入全文,并让当前会话所接收的 Work 将最新终态结果提供给后续对话;过程播报和语音输出仍保持简短。继续沿用 Provider
来源、Host 完成度及会话绑定,重启后可从现有台账读取,不新增持久化结构。

同时将“通常最多 6 句;要求详细或准确充分回答确有需要时可超过”的规则加入内置红莉栖日语人格。人格覆盖字段默认仍留空,已有自定义覆盖继续优先。

包含 #177 的最新提交已通过 223 项相关回归和静态检查;实际主模型的合成报告对照已通过。本地主线及 Electron
构建已更新,供维护者实机验收。最新提交的 14 项 CI 已全部通过,包括三组全量 Python 测试、Electron 构建和 Windows
桌面冒烟。维护者于 2026-10-11(Pacific/Auckland)确认实机验收通过。合成报告验证不代表对真实新闻的事实核验。
Lucas1479 added a commit that referenced this pull request Oct 10, 2026
Prepare `v0.16.1-alpha.0` as the next source Alpha after
`v0.16.0-alpha.0`, covering merged #177–#181: automatic NVIDIA TTS
acceleration, complete terminal Work context, ASR-overlapped application
preparation, and cold translation-client setup outside the audio event
loop.

Synchronize Python/Electron product versions and lock metadata, update
both README release links, include the new release/acceptance documents
in the source ZIP, and test native settings upgrade from 0.16.0. The
native upgrade probe also resolves history from the repository root and
preserves the previous tag's settings/shared-module layout: its old
single-file extraction failed on 0.16.0's catalog imports. No dependency
selection or production behavior changes are added by this preparation
PR.

Validation completed locally: 128 release/voice/entry regression tests;
`uv lock --check --offline`; version/lock consistency; third-party
provenance release gate; `git diff --check`; clean source-archive gate
(3,891 selected files, zero errors/warnings). All 3,891 ZIP file hashes
and its embedded manifest were verified. Local Electron build and native
encrypted-settings upgrade from both 0.16.0 and 0.15.2 passed; the
actual extracted ZIP was separately installed/built and passed the
0.16.0 native upgrade; the initial module-extraction failure and repair
are recorded in acceptance. Full final-head CI and extracted-source
install/build/package/startup are the merge gates.

The acceptance record contains sanitized real microphone observations
from #179/#180 and explicitly separates them from a controlled A/B,
acoustic measurement, ASR speedup, physical barge-in acceptance or #181
VN acceptance. Existing dependency findings and experimental-platform
limits remain. User configuration, raw logs and external media are
excluded.

After checks pass, publication uses the clean merged commit, the
repository's source-Alpha Latest convention, a verified tag, final
source ZIP, per-file manifest and SHA-256 checksums. Related: #176.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant