gamemlx
Pure MLX inference for GAME (Guided Automatic Music Extraction) — vocal → MIDI, running on Apple Silicon GPU. Numerically aligned with the torch reference; fp32 output is bit-comparable on the test set (20/20 files, all onset/offset/pitch diffs 0.0000) and ~9.4× faster than torch CPU.
Install
uv tool install gamemlx # or: pip install gamemlx
Quick start
# download weights (HF: baicai1145/GAME-MLX-medium, ModelScope fallback) and extract
gamemlx extract vocals.wav -m medium --language zh
# local model dir, fp16, custom decoding params
gamemlx extract song/ -m ./weights/GAME-1.0-medium-mlx \
--precision fp16 --language zh --tempo 120 \
--seg-threshold 0.2 --seg-radius 0.02 --est-threshold 0.2 \
--t0 0 --nsteps 8 --output-dir out/
Python API:
from gamemlx import load_model, extract
model, lang_map = load_model("medium", precision="fp32")
mids = extract(model, "vocals.wav", language="zh", rng_seed=42)
Models
| alias | HuggingFace | files |
|---|---|---|
small / medium / large |
baicai1145/GAME-MLX-{small,medium,large} |
config.yaml, lang_map.json, weights(.fp16).safetensors |
Weights convert 1:1 from official GAME checkpoints (torch state_dict keys kept
verbatim). First use downloads to ~/.cache/gamemlx; ModelScope mirrors are
used automatically when HF is unreachable.
Alignment & performance (vs GAME torch CPU, 20-file set)
| precision | sequence match | max pitch diff | max onset/offset diff |
|---|---|---|---|
| fp32 | 20/20 identical | 0.0000 | 0.0000 s |
| fp16 | 19/20 (one borderline d3pm flip, analyzed) | 0.0011 | 0.0000 s |
| engine | total inference (20 files) | avg / file | peak RSS |
|---|---|---|---|
| torch CPU (32-true) | 32.19 s | 1.609 s | 971 MB |
| gamemlx fp32 | 3.44 s | 0.172 s (9.4×) | 616 MB |
| gamemlx fp16 | 4.76 s | 0.238 s | 441 MB |
Details: docs/ALIGNMENT.md, docs/BENCH.md.
Notes
- d3pm sampling randomness is injectable (
rng_matrices/--rng-seed) for reproducible comparisons against torch. - fp32 recommended for exact parity; fp16 saves memory (~111MB wired) with sub-0.002 pitch deviation.
Metadata
Release files for gamemlx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gamemlx-0.1.0.tar.gz | 33.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gamemlx-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.6 kB
Release files / gamemlx-0.1.0.tar.gz
| Download URL | gamemlx-0.1.0.tar.gz |
|---|---|
| Size | 33.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49ee9077a2503d3a9d9718ef5fd9dedbe3959af3c1a4b59bbd7a160fb98344e6
|
|
BLAKE2b-256 checksum How to use checksums |
91f8bf3097a0ff01e5ca3e53e550550b6128d6b44c7e0e1baf3a92ee327cdef9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / gamemlx-0.1.0-py3-none-any.whl
| Download URL | gamemlx-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d4056fe019a39bee6463b71592d1778ee0013e6f0479ba78a74ee846cd0f548
|
|
BLAKE2b-256 checksum How to use checksums |
782cc13852b4841217ab47815b93775d3cc7be5f2f4d517d9a8514b00a8a86f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for gamemlx 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.