Aqua-TTS

This project includes code from the following third-party projects:

---

## GPT-SoVITS

Upstream runtime: supplied separately through GPT_SOVITS_HOME.
Integration/optimization files: aquatts/upstream.py
                                aquatts/modeling/t2s_streaming.py
                                aquatts/modeling/t2s_flash_attn.py

Copyright (c) 2024 RVC-Boss
Licensed under the MIT License.
https://github.com/RVC-Boss/GPT-SoVITS

Runtime modifications applied in memory:
- Replaced dynamic `torch.cat` KV cache with static `scatter_` buffers
- Added bucketed CUDA Graph capture/replay (6 bucket sizes, 13 pre-captured pairs)
- Added `cuda_graph_stats` dict for per-step and EOS performance logging
- Added `precapture_cuda_graph()` for eager graph enumeration at model load
- Added `apply_cuda_graph_patch()` entry point in aquatts.modeling
- Added fallback-on-error path: CUDA Graph → static KV → dynamic torch.cat

Pro/Plus integration: aquatts/inference/speaker.py adapts the feature and model
loading contract of upstream GPT_SoVITS/sv.py (MIT, RVC-Boss, revision 08d627c).
ERes2NetV2, its Kaldi feature helpers, and all weights are loaded from the external
upstream checkout; they are not redistributed in Aqua's wheel. The upstream
ERes2NetV2 source retains its 3D-Speaker Apache-2.0 notice. This integration does
not copy Amadeus-owned runtime or application code.

The namespace bridge files aquatts/_vendor/GPT_SoVITS/AR/__init__.py and
aquatts/_vendor/GPT_SoVITS/AR/models/__init__.py use pkgutil.extend_path
to merge with the selected upstream GPT-SoVITS package at import time. Aqua-TTS
does not redistribute a modified GPT-SoVITS t2s_model.py.

---

## NVIDIA BigVGAN

Files: aquatts/bigvgan/cuda/anti_alias_activation.cpp
       aquatts/bigvgan/cuda/anti_alias_activation_cuda.cu
       aquatts/bigvgan/cuda/compat.h
       aquatts/bigvgan/cuda/type_shim.h

Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
Licensed under the Apache License, Version 2.0.

http://www.apache.org/licenses/LICENSE-2.0

Modifications: Added at::cuda::CUDAGuard for multi-device safety.
  Added MSVC auto-discovery loader (aquatts/bigvgan/cuda/load.py) that compiles
  the kernel and caches .pyd files per GPU, Python, Torch, and CUDA runtime.

---

## alias-free-torch (BigVGAN anti-alias activation)

Files: aquatts/bigvgan/torch/__init__.py
       aquatts/bigvgan/torch/act.py
       aquatts/bigvgan/torch/filter.py
       aquatts/bigvgan/torch/resample.py

Adapted from https://github.com/junjun3518/alias-free-torch
under the Apache License, Version 2.0.

http://www.apache.org/licenses/LICENSE-2.0
