Skip to content

Commit aa68a2d

Browse files
committed
docs: bilingual section headers + intro (zh/en)
1 parent 2be87c9 commit aa68a2d

2 files changed

Lines changed: 31 additions & 27 deletions

File tree

BUILDING.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# Building from source
1+
# Building from source · 从源码构建
22

33
This document covers how to build `game_ggml_cli` from source on Linux, macOS and
44
Windows. The project is self-contained — all dependencies are pulled via CMake
55
FetchContent at configure time.
66

7-
## Prerequisites
7+
本文档覆盖在 Linux、macOS、Windows 上从源码构建 `game_ggml_cli`。项目自包含——所有依赖在 configure 时经 CMake FetchContent 拉取。
88

9-
### Linux
9+
## Prerequisites · 前置要求
10+
11+
### Linux · Linux
1012

1113
```bash
1214
# Build tools
@@ -28,7 +30,7 @@ sudo apt install libvulkan-dev vulkan-tools
2830
sudo apt install ccache
2931
```
3032

31-
### macOS
33+
### macOS · macOS
3234

3335
```bash
3436
# Xcode Command Line Tools
@@ -42,7 +44,7 @@ brew install cmake ccache
4244
# cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 ...
4345
```
4446

45-
### Windows
47+
### Windows · Windows
4648

4749
```bash
4850
# Visual Studio 2022+ with "Desktop development with C++" workload
@@ -60,7 +62,7 @@ brew install cmake ccache
6062
# CUDA 12.6 supports Visual Studio 2022 / MSVC 193x.
6163
```
6264

63-
## Quick start
65+
## Quick start · 快速开始
6466

6567
```bash
6668
# Clone
@@ -79,7 +81,7 @@ cmake --build build -j
7981
build/bin/game_ggml_cli --version
8082
```
8183

82-
## Backend selection
84+
## Backend selection · 后端选择
8385

8486
Pass one (or more) of these flags to the **Configure** step:
8587

@@ -92,7 +94,7 @@ Pass one (or more) of these flags to the **Configure** step:
9294
If no GPU backend is enabled, the CPU backend is used as fallback. The best
9395
available backend is selected automatically at runtime.
9496

95-
### Examples
97+
### Examples · 示例
9698

9799
```bash
98100
# Linux + Vulkan
@@ -131,7 +133,7 @@ cmake -B build -DCMAKE_BUILD_TYPE=Release `
131133
-DCMAKE_CUDA_ARCHITECTURES="75"
132134
```
133135

134-
## Converting a PyTorch checkpoint to GGUF
136+
## Converting a PyTorch checkpoint to GGUF · 转换 PyTorch 权重为 GGUF
135137

136138
The medium model checkpoint can be downloaded from
137139
[OpenVPI releases](https://github.com/openvpi/GAME/releases/download/v1.0.0/GAME-1.0-medium.zip).
@@ -159,7 +161,7 @@ Expected output for the medium model:
159161
tensors : 671
160162
```
161163

162-
## Running inference
164+
## Running inference · 运行推理
163165

164166
```bash
165167
# Single file
@@ -209,15 +211,15 @@ recommended. The packages currently expect the CUDA 12 runtime and cuBLAS
209211
libraries to be installed on the target system; they do not bundle NVIDIA's
210212
runtime libraries or the driver (`nvcuda.dll` comes from the NVIDIA driver).
211213

212-
## Troubleshooting
214+
## Troubleshooting · 故障排查
213215

214216
### CUDA Toolkit not found
215217

216218
Ensure `nvcc --version` succeeds and that `CUDA_PATH` (or the platform-specific
217219
Toolkit environment) points to the intended installation. Delete `build/` before
218220
reconfiguring after changing CUDA Toolkit versions.
219221

220-
### glslc not found (Linux/Windows Vulkan)
222+
### glslc not found (Linux/Windows Vulkan) · glslc 未找到(Linux/Windows Vulkan)
221223

222224
The Vulkan SDK's `glslc` compiler is required by the ggml-vulkan backend. If
223225
`FindVulkan` reports `glslc` as missing, ensure the SDK is installed and its
@@ -233,7 +235,7 @@ set VULKAN_SDK=C:\VulkanSDK\1.4.304.1
233235
set PATH=%VULKAN_SDK%\Bin;%PATH%
234236
```
235237

236-
### `unknown target CPU 'apple-m1'` (macOS x86_64 cross-compile)
238+
### `unknown target CPU 'apple-m1'` (macOS x86_64 cross-compile) · `unknown target CPU 'apple-m1'`(macOS x86_64 交叉编译)
237239

238240
When cross-compiling for Intel Mac on an Apple Silicon runner, the CPU backend
239241
mistakenly detects the host as `apple-m1`. Disable native CPU detection:
@@ -242,7 +244,7 @@ mistakenly detects the host as `apple-m1`. Disable native CPU detection:
242244
cmake -B build -DGGML_NATIVE=OFF ...
243245
```
244246

245-
### `FetchContent` download failures
247+
### `FetchContent` download failures · `FetchContent` 下载失败
246248

247249
Dependencies are fetched via Git at configure time. If you are behind a proxy:
248250

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# GAME ggml backend
1+
# GAME ggml backend · GAME ggml 后端
22

33
Native C++ inference for the [GAME](https://github.com/openvpi/GAME) singing-voice-to-MIDI model, built on
44
[ggml](https://github.com/ggerganov/ggml). Runs on CPU, Metal (default on
55
Apple Silicon), CUDA, or Vulkan. Drop-in replacement for
66
`python infer.py extract` with no Python dependency at runtime.
77

8-
## Highlights
8+
基于 [ggml](https://github.com/ggerganov/ggml)[GAME](https://github.com/openvpi/GAME) 歌声转 MIDI 模型原生 C++ 推理实现,支持 CPU、Metal(Apple Silicon 默认)、CUDA、Vulkan;是 `python infer.py extract` 的运行时零 Python 依赖替代品。
9+
10+
## Highlights · 特性亮点
911

1012
- **End-to-end CLI** — WAV in, MIDI/TXT/CSV out (mirrors Python `extract`).
1113
- **Small footprint**~50 MB GGUF for the 1.0-medium checkpoint, ~50 M params.
@@ -16,7 +18,7 @@ Apple Silicon), CUDA, or Vulkan. Drop-in replacement for
1618
- **Parity-tested** — full pipeline output matches the PyTorch reference bit-for-bit
1719
when the same RNG numbers are injected.
1820

19-
## Architecture
21+
## Architecture · 架构
2022

2123
```
2224
waveform (44100 Hz mono)
@@ -40,7 +42,7 @@ waveform (44100 Hz mono)
4042
Gaussian-blurred pitch decode → notes (offset, duration, pitch, voiced)
4143
```
4244

43-
## Build
45+
## Build · 构建
4446

4547
```bash
4648
cmake -S ggml_backend -B ggml_backend/build \
@@ -59,7 +61,7 @@ Options:
5961
| `GAME_GGML_BUILD_CLI` | `ON` | Build `game_ggml_cli` |
6062
| `GAME_GGML_BUILD_TESTS` | `OFF` | Build GoogleTest suite |
6163

62-
## Convert a PyTorch checkpoint
64+
## Convert a PyTorch checkpoint · 转换 PyTorch 权重
6365

6466
```bash
6567
pip install -r ggml_backend/scripts/requirements.txt
@@ -78,7 +80,7 @@ Inspect the result:
7880
./ggml_backend/build/bin/game_ggml_cli inspect ggml_backend/assets/game_small.gguf
7981
```
8082

81-
## Run inference
83+
## Run inference · 运行推理
8284

8385
```bash
8486
./ggml_backend/build/bin/game_ggml_cli extract input.wav \
@@ -107,7 +109,7 @@ Inspect the result:
107109
| `--round-pitch` | `--round-pitch` |
108110
| `--rng-replay <path>` | *(new)* — replay D3PM random numbers from a file for bit-exact parity with PyTorch |
109111

110-
## Performance
112+
## Performance · 性能
111113

112114
Measured on Apple M4 (macOS, 16-core Apple Silicon), 3 runs per side under
113115
`/usr/bin/time -l`, fresh subprocess each run (so peak RSS is clean). Input:
@@ -161,7 +163,7 @@ estimator ~0.06 s (~ 6%) x_est + regions → notes (4× JEBF + joint attn)
161163
Segmenter dominates because D3PM loops it `--nsteps` times. Default `1`
162164
keeps it cheap; bump to `4` or `8` for higher quality at linear cost.
163165

164-
## Reproducing the benchmark
166+
## Reproducing the benchmark · 复现基准测试
165167

166168
```bash
167169
# 1. Resample to 44.1 kHz / mono (if not already)
@@ -186,7 +188,7 @@ python3 ggml_backend/scripts/benchmark_align.py /tmp/28_44100.wav \
186188
-l zh -o /tmp/bench_out --runs 3
187189
```
188190

189-
## Using as a third-party library
191+
## Using as a third-party library · 作为第三方库使用
190192

191193
```cmake
192194
add_subdirectory(path/to/GAME/ggml_backend)
@@ -223,7 +225,7 @@ include any ggml header.
223225
See [`examples/external_consumer/`](examples/external_consumer/) for a minimal
224226
standalone CMake project that builds against the library.
225227

226-
## Tests
228+
## Tests · 测试
227229

228230
```bash
229231
ctest --test-dir ggml_backend/build --output-on-failure
@@ -247,7 +249,7 @@ The suite has 37 tests covering:
247249
Reference dumps are generated by `python scripts/dump_reference.py --category all`.
248250
Dumps are gitignored — regenerate them as part of CI.
249251

250-
## Known limitations (v1)
252+
## Known limitations (v1) · 已知限制(v1)
251253

252254
- **44100 Hz mono WAV only** — other sample rates raise `InvalidWav`. Resampling
253255
is deliberately out-of-scope to keep the footprint small.
@@ -261,7 +263,7 @@ Dumps are gitignored — regenerate them as part of CI.
261263
- **Metal FP32 precision** — expected ~1e-3 per matmul; at boundary decoding
262264
this can flip one frame out of every few hundred vs the CPU reference.
263265

264-
## Dependencies
266+
## Dependencies · 依赖
265267

266268
Everything is fetched at configure time by CMake; nothing is vendored. Source
267269
trees live under `build/_deps/<name>-src/` after the first configure.
@@ -277,7 +279,7 @@ Each upstream LICENSE file is preserved under `build/_deps/<name>-src/LICENSE*`
277279
after download. To update a dependency, change its `GIT_TAG` in
278280
`cmake/Dependencies.cmake` and reconfigure.
279281

280-
## License
282+
## License · 许可
281283

282284
MIT — same as the parent [GAME project](https://github.com/openvpi/GAME). Redistributions should
283285
also carry the upstream license notices listed in the table above.

0 commit comments

Comments
 (0)