SIGN IN SIGN UP

Add opt-in native fp16 and regional torch.compile, optimize RoFormer/MPS inference, and move to a validated PyTorch 2.13 baseline (#298)

* perf: optimize PyTorch stem separation

- eliminate redundant RoFormer tail chunks and reuse consecutive model loads

- keep supported MPS spectral work and bounded accumulators on-device

- add observable precision modes and regional compilation with safe fallbacks

- preserve float32 numerical islands and scaled BS-RoFormer attention

* build: require the validated PyTorch baseline on Apple Silicon

- publish platform-aware requirements through Poetry 2 and PEP 621 metadata

- require PyTorch 2.13 on Apple arm64 while preserving the existing 2.8 lock on other Python <3.14 platforms

- use the first torch and torchvision pair with CPython 3.14 wheels and mirror torchvision's Python 3.14.1 exclusion

* docs: describe accelerated inference modes

- document Apple Silicon MPS spectral paths, bounded buffers, and the PyTorch baseline

- explain precision and regional compilation capabilities and fallbacks

- describe effective-mode reporting and consecutive model reuse

* fix: preserve loaded model state when reloads fail

* fix: keep regional SDPA inside compiled graphs

* fix: restore model metadata when reusing instances

* docs: clarify inference benchmark scope and fallbacks

* build: use PyTorch 2.13 in the Linux lock

- align the contributor CUDA environment with the validated runtime\n- preserve the existing published range and Windows development lock

* fix: load linear-attention BS-RoFormer models

- Forward linear_transformer_depth through the normalized loader path.
- Preserve zero-depth behavior for existing BS-RoFormer configurations.
- Cover string normalization and constructor forwarding with unit tests.

* docs: explain the rotary autocast workaround

- Name the pinned rotary-embedding-torch 0.6.5 behavior precisely\n- Link the still-open upstream device-hardcoding issue\n- Document why audio-separator keeps rotary angle construction in float32

* docs: clarify retained model lifetime

- Explain when reused model weights remain allocated or are replaced.
- Document the intentionally per-separation Demucs network lifecycle.

* chore: address final review feedback

- declare packaging as a direct runtime dependency
- document the CUDA 13 driver floor for the contributor lock
- clarify the locked rotary dependency and fallback warning

* test: cover MPS accumulation at the byte limit

* perf: size the MPS accumulation budget per device

- Derive the budget from the free Metal working set instead of a constant
- Keep the 1 GiB floor when Metal cannot report a working-set size
- Add AUDIO_SEPARATOR_MPS_BUFFER_BUDGET_GIB to override the heuristic
- Name the buffers that move to CPU in the fallback logs and the README

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: trim the README additions to user-facing behavior

- Replace the MPS buffer budget internals with the threshold and its override
- Drop the rotary-embedding-torch pinning rationale and the compile retry mechanics
- Merge the duplicate VR/Demucs rows in the verified-combination table

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test: skip the fp16 SNR gates on virtualized Apple GPUs

- Hosted CI Macs expose a paravirtual Metal device (VirtualMac*) whose
  half-precision accumulation cannot meet the 30 dB gate
- Detect virtualization via hw.model so real Apple GPUs keep the gates

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: name the rotary internals the fp32 helper depends on

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: harden the virtualization probe against sysctl failures

- Catch subprocess.TimeoutExpired, which is not an OSError
- Treat a non-zero sysctl exit as not virtualized
- Unknown environments keep the SNR gates active

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: call sysctl by its absolute path in the virtualization probe

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci: retry the macOS dependency install on network failures

- Hosted macOS runners dropped the same large wheel download mid-transfer
  in two consecutive runs, cancelling the whole matrix through fail-fast
- Completed downloads are reused from the poetry cache between attempts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
N
ntamotsu committed
7a1c06f42fb5c0a7dd5dcdf45bead5bcababdbae
Parent: ce6463d
Committed by GitHub <noreply@github.com> on 8/27/2026, 1:24:41 AM