audio.cpp
An all-in-one, pure C++ inference engine for audio models, powered by ggml. Supports TTS, STT, VAD, voice conversion, music generation, and more, with highly optimized performance. No Python dependency.
- 4.4k
- C++
- 9 h ago
Evaluation-backed AMD ROCm port of HunyuanOCR-1.5 with reproducible OmniDocBench v1.6 benchmarks across llama.cpp, vLLM, and Transformers on gfx1100.
Repo AIwork4me/HunyuanOCR-ROCm, read from GitHub 1 d ago. AIwork4me has not joined Take My Repo.
AIwork4me/HunyuanOCR-ROCm is a public repo on GitHub by AIwork4me. Evaluation-backed AMD ROCm port of HunyuanOCR-1.5 with reproducible OmniDocBench v1.6 benchmarks across llama.cpp, vLLM, and Transformers on gfx1100. It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it. It is written mainly in Python, has 4 stars and last changed on 2026-11-20. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.

Evaluation-backed AMD ROCm port of HunyuanOCR-1.5 — runs the model on AMD gfx1100 (RDNA3) across three inference backends and reports OmniDocBench v1.6 results. Not a precision-aligned port: the official headline is measured with a different engine (TensorRT). See Benchmark methodology.
The gfx1100 investigation in this project helped isolate a lower-level vLLM RDNA3 W4A16 kernel issue beyond the original HunyuanOCR symptom.
The affected RDNA3W4A16LinearKernel / gptq_gemm_rdna3 split-K path
accumulated bf16/fp16 partials in an execution-order-dependent way. The
upstream fix replaces the affected reduction path with deterministic FP32
partial accumulation and fixed-order reduction, while also improving the fp16
dequantization path and small-batch performance.
4ac0d0eThis upstream fix addresses the RDNA3 W4A16 quantized-GEMM accuracy and determinism issue uncovered during the investigation. It should not be interpreted as a fix for every HunyuanOCR long-context issue; the original long-sequence behavior was investigated separately. HunyuanOCR-1.5 runs bf16 in this repo, so the W4A16 kernel path is not exercised by the published benchmark numbers, which are unchanged.
AMD gfx1100 (RDNA3, 48 GB ×4, ROCm 7.2), bf16, OmniDocBench v1.6. Two separate page sets are reported below — they are never mixed into one column, because their numbers are not comparable. Full provenance and the definition of "precision-aligned" are in Benchmark methodology.
| Page set | Backend | Overall | Source |
|---|---|---|---|
| canary 148 | llama.cpp | 93.33 | REPRO.yaml |
| canary 148 | transformers | 94.11 | REPRO.yaml |
| canary 148 | vLLM | 94.81 | REPRO.yaml |
| full 1651 | llama.cpp | 92.09 | REPRO.yaml |
| full 1651 | transformers | 94.05 | REPRO.yaml |
| full 1651 | vLLM | 91.31 | REPRO.yaml |
| official | TensorRT | 94.10 | official HunyuanOCR table |
| Backend | Overall | text EditDist↓ | formula CDM↑ | table TEDS↑ | order EditDist↓ | Resolution | Status |
|---|---|---|---|---|---|---|---|
| vLLM 0.16.1 (Flash-Attn ViT) | 94.81 | 0.0514 | 0.9648 | 0.9308 | 0.1135 | capped 3.4M | 148/148 complete |
| transformers 5.13.0 (SDPA ViT) | 94.11 | 0.0437 | 0.9425 | 0.9246 | 0.1184 | capped 3.4M | 148/148 complete |
| llama.cpp (C++ GGML, BF16 GGUF) | 93.33 | 0.0512 | 0.9083 | 0.9429 | 0.1270 | uncapped | 148/148 complete |
Overall = ((1−text)·100 + CDM·100 + TEDS·100)/3; order EditDist is reported
separately and is not part of Overall.
| Backend / source | Overall | text EditDist↓ | formula CDM↑ | table TEDS↑ | Inference engine | Notes |
|---|---|---|---|---|---|---|
| llama.cpp (this repo, gfx1100/ROCm) | 92.09 | 0.0467 | 0.8964 | 0.9130 | llama.cpp C++ GGML (HIP) | 1651/1651, 0 errors; scored twice |
| Official HunyuanOCR (OmniDocBench) | 94.10 | 0.042 | 0.9473 | 0.9181 | TensorRT | official table |
| Δ (ours − official) | −2.01 | +0.0047 | −0.0509 | −0.0051 | different engine | not a precision comparison |
The −2.01 gap is not a measured engine-level delta. The official number uses a third inference engine (TensorRT) and an unlabeled dataset version; ours uses llama.cpp on v1.6. A 94.74 figure quoted in some third-party summaries is not in the official benchmark table and is treated as
not_verified.
vLLM full-set: VALIDATED (2026-07-25) — 91.31 Overall. Root-caused and fixed: (1) server
--max-model-len 32768was too small → raised to 65536; (2) missing--max-pixels 3400000ViT cap → large pages errored; (3) concurrency collapses throughput → run sequential (compiled, ~7 s/page). Result on the full 1651: text 95.48% · table TEDS 86.00% · formula CDM 92.46% (2352 formulas, 0 exceptions) · Overall 91.31 · 0 errors. CDM required a full host toolchain (TUG TeX Live 2025 + CJK/gkaiu + latexmlc + ImageMagick 7 + the#mathcolorpatch); one-shot reprovisioner:provision_cdm_host.sh(eval-workspace script). Comparable to llama.cpp (92.09, uncapped full-res).
Key findings:
The vLLM full-set — previously documented as "invalid" (servers crashed, ~780 ERROR pages, excluded 46.31) — is now a valid, comparable result after fixing three crash root causes and standing up the CDM toolchain on the host.
Result (OmniDocBench v1.6, full 1651 pages, gfx1100/ROCm, capped 3.4 Mpx, compiled vLLM, sequential):
| Metric | Value |
|---|---|
| text_block Edit_dist → accuracy | 0.0452 → 95.48% |
| table TEDS | 86.00% |
| formula CDM (2352 formulas, 0 exceptions) | 92.46% |
| Overall = ((1−text)·100 + CDM·100 + TEDS·100)/3 | 91.31 |
| hard errors | 0 / 1651 |
Root causes fixed (the original "invalid"):
--max-model-len 32768 was too small — input + 32768 output tokens
overflowed the context (mass 400 errors). Fix: 65536 (the serve_vllm.sh
tuned default).--max-pixels ViT cap — 56% of OmniDocBench pages exceed 3.4 Mpx and
exceed the gfx1100 ViT / encoder-cache limit. Fix: --max-pixels 3400000.CDM toolchain (host): CDM silently scored 0 until the full chain was in
place — Debian texlive-full lacks the Arphic gkai font, and TL2025's
xcolor swallows \mathcolor. Required: official TUG TeX Live 2025 +
cjk/arphic gkaiu (+ xcolor/amsmath/upgreek/…) + gkaiu in
pdftex.map + latexmlc (LaTeXML) + ImageMagick 7 + the #mathcolor
patch in the OmniDocBench checkout. One-shot, idempotent, re-runnable after
pod rebuild: provision_cdm_host.sh (eval-workspace reprovisioner; all 7 steps).
Failure-mode analysis: omnidocbench-rocm/docs/pitfalls.md (#cdm-zero tree).
vLLM full-set (91.31, capped 3.4 Mpx) remains slightly below llama.cpp (92.09, uncapped full-res) — the pixel cap costs table/dense-page quality. llama.cpp is still the recommended backend for the best score; vLLM is now a valid alternative.
Full per-GPU matrix (verified / community / unknown): see docs/hardware-matrix.md. Only gfx1100/ROCm 7.2 is maintainer-verified; everything else is honestly marked.
| Use case | Status | Notes |
|---|---|---|
| Single-GPU inference — llama.cpp (HIP) | ✅ Verified | gfx1100 48 GB; warm ~1.4 s/page |
| 4-GPU full-set throughput — llama.cpp | ✅ Verified | one server/GPU; full 1651 in ~hours |
| vLLM canary (148) | ✅ Verified | 94.81 Overall |
| transformers canary (148) | ✅ Verified | 94.11 Overall |
| vLLM full-set (1651) | ✅ Validated | 91.31 Overall (capped 3.4M, sequential); see validation |
| transformers full-set (1651) | ⚠️ Not verified | ~40 h, impractical |
| Minimum VRAM | ❔ Unknown | not measured — do not assume a number |
| Other RDNA3 / non-gfx1100 | ❔ Unknown | not tested; file a ROCm-compat issue |
A single gfx1100 is sufficient for inference and the canary; 4 GPUs are only needed for full-set throughput, not for correctness.
Before downloading or using the weights, review the Tencent Hunyuan Community License (LICENSES/LicenseRef-Tencent-Hunyuan-Community-License.txt, official). The license does not apply in the EU, UK, or South Korea, and it is not OSI Open Source. See NOTICE for the full mixed-license breakdown. Original packaging/tooling in this repo is Apache-2.0; code ported from HunyuanOCR and the weights are under the Tencent Hunyuan Community License.
This runs the model on a local gfx1100 and scores it on one OmniDocBench v1.6 page set. You use two terminals: Terminal A runs the inference server; Terminal B runs predict → validate → score. Every command uses absolute paths derived from the variables below, so neither terminal depends on your current directory.
git clone https://github.com/AIwork4me/HunyuanOCR-ROCm.git
cd HunyuanOCR-ROCm
From the repo root you just entered (HunyuanOCR-ROCm/):
export HUNYUAN_ROCM_DIR="$PWD"
export LLAMA_DIR="$HUNYUAN_ROCM_DIR/third_party/llama.cpp" # llama.cpp build
export GGUF_DIR="$HUNYUAN_ROCM_DIR/models/HunyuanOCR-GGUF" # downloaded weights
export DATA_DIR="/path/to/OmniDocBench_data" # GT json + images/
Set DATA_DIR to your local OmniDocBench v1.6 data directory.
# in $HUNYUAN_ROCM_DIR (shared by both terminals)
pip install -e ".[client,download]" # core + openai client + hf downloader; NO torch
# developers: pip install -e ".[client,download,dev]"
ROCm PyTorch is not a dependency and is not installed by the above — it is only needed for the transformers/vLLM backends. Install it separately from a verified ROCm wheel source for your stack. The llama.cpp backend needs no torch.
# uses $LLAMA_DIR explicitly — current directory does not matter
git clone https://github.com/ggml-org/llama.cpp.git "$LLAMA_DIR"
cd "$LLAMA_DIR"
git checkout a320cbfcb7056b7b81fb854d97fe01d0ea77c4b5
# locked commit for the published results (see REPRO.yaml)
HIPCXX=/opt/rocm/llvm/bin/clang HIP_PATH=/opt/rocm \
cmake -S . -B build -DGGML_HIP=ON -DGPU_TARGETS=gfx1100 \
-DGGML_HIP_ROCWMMA_FATTN=ON -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON
cmake --build build --config Release -j$(nproc) --target llama-server
latestmaster is not guaranteed to reproduce the published numbers — always check out the locked commit above. If your ROCm stack lacks the rocWMMA headers, fall back to a non-rocWMMA build: drop-DGGML_HIP_ROCWMMA_FATTN=ON(slower, but functional).
# uses $GGUF_DIR explicitly — current directory does not matter
hf download ggml-org/HunyuanOCR-GGUF \
HunyuanOCR-bf16.gguf mmproj-HunyuanOCR-bf16.gguf \
--local-dir "$GGUF_DIR"
sha256sum "$GGUF_DIR"/*.gguf
# compare against REPRO.yaml -> model.benchmark_artifact
# one server per GPU for throughput; here, one on port 8081
"$LLAMA_DIR/build/bin/llama-server" \
--model "$GGUF_DIR/HunyuanOCR-bf16.gguf" \
--mmproj "$GGUF_DIR/mmproj-HunyuanOCR-bf16.gguf" \
--host 127.0.0.1 --port 8081 --alias HYVL \
-ngl 999 -c 65536 -n 32768
Network safety.
llama-serverhas no default strong authentication. The default bind is127.0.0.1(loopback only). For remote access, put a reverse proxy with authentication in front and restrict it with a firewall — do not expose the server to the public internet. The-c 65536context is required for large uncapped images (32768 overflows). Leave this running in Terminal A.
All commands run from $HUNYUAN_ROCM_DIR (the repo root) — they never depend
on you being inside llama.cpp.
cd "$HUNYUAN_ROCM_DIR"
# (optional) materialize the 148-page canary from the full GT, byte-identically:
hunyuan-ocr canary materialize \
--full-gt "$DATA_DIR/OmniDocBench.json" \
--manifest "$HUNYUAN_ROCM_DIR/eval/canary_148.manifest.json" \
--out "$DATA_DIR/OmniDocBench_canary_148.json"
# predict (note --backend-name llamacpp; --ports must match Terminal A)
python scripts/run_inference.py \
--backend-name llamacpp --server-alias HYVL \
--gt-json "$DATA_DIR/OmniDocBench_canary_148.json" \
--images-dir "$DATA_DIR/images" \
--pred-dir "$HUNYUAN_ROCM_DIR/artifacts/predictions" \
--host 127.0.0.1 --ports 8081 --model HYVL --concurrency 8
# validate (blocks scoring on missing/empty/ERROR pages)
python scripts/validate_predictions.py \
--gt-json "$DATA_DIR/OmniDocBench_canary_148.json" \
--pred-dir "$HUNYUAN_ROCM_DIR/artifacts/predictions"
# score (requires the OmniDocBench scorer venv; see REPRO.yaml)
python scripts/score_predictions.py \
--pred-dir "$HUNYUAN_ROCM_DIR/artifacts/predictions" \
--gt-json "$DATA_DIR/OmniDocBench_canary_148.json"
The same steps are available via the unified CLI
(hunyuan-ocr doctor | validate | manifest verify | canary materialize | predict | score);
predict and score work from a wheel install too. Run hunyuan-ocr doctor to
check your environment, or hunyuan-ocr doctor --strict --backend llamacpp --json
for a CI-friendly gate.
Contributor orientation (pipeline + per-module roles, 5-minute read): docs/architecture.md.
src/hunyuan_ocr/
├── contract.py # FROZEN decoding contract (prompt, sampling, image config)
├── tasks.py # 12 task prompts (verbatim port from upstream)
├── postprocess.py # clean_repeated_substrings + process_one (verbatim port)
├── runner.py # atomic writes, resumability, run-manifest, writer lock
├── validation.py # pre-score prediction-dir validation
├── preflight.py # input validation + sharding (fail before model load)
├── endpoint_pool.py # circuit-breaking OpenAI-compatible endpoint pool
├── scoring.py # OmniDocBench config writer + scorer + result parser
├── canary.py # rebuild the 148-page canary from the full GT
├── cli.py # unified `hunyuan-ocr` CLI
├── omnidocbench.py # dataset iteration + prediction filename mapping
└── backends/
├── transformers.py # transformers backend (Phase 1 oracle)
└── vllm_client.py # OpenAI-compatible client (vLLM / llama-server / any OAI)
scripts/
├── run_inference.py # OpenAI-compatible driver (llama.cpp/vLLM); canonical name
├── run_openai_compatible.py # generic alias of run_inference.py
├── run_phase2_vllm.py # back-compat shim → run_inference.py
├── run_phase1_transformers.py # multi-GPU transformers driver (via `hunyuan-ocr predict --backend transformers`)
├── serve_vllm.sh # start a vLLM server (HIP, compiled, tuned)
├── score_predictions.py / validate_predictions.py # score / validate wrappers
├── reproduce_llamacpp_{canary,full}.sh # locked-commit reproduce scripts
├── create_canary_manifest.py # (re)generate eval/canary_148.manifest.json
└── check_repo.py # CI integrity checks (lock, manifest, links, SPDX)
eval/canary_148.manifest.json # the 148 canary pages (file order) + source-GT SHA256
REPRO.yaml # pinned inputs: commits, GT/model SHA256, env, metrics
reports/ # canary BASELINE + stage summary (Historical)
LICENSES/ NOTICE .github/workflows/ # mixed-license texts + CI
Internal design/planning notes live under
docs/superpowers/and are not part of the user-facing architecture.
| Adaptation | Reason | Where |
|---|---|---|
ViT pixel cap (3.4M, HUNYUANOCR_VIT_MAX_PIXELS) |
ROCm SDPA ViT NaN above ~14.2k tokens (#6416) | backends/transformers.py |
| SDPA attention (vs eager) | ~1.4× faster on RDNA3 | backends/transformers.py |
| torch.compile for vLLM | ~28× decode speedup (2→150 tok/s) | scripts/serve_vllm.sh |
-c 65536 for llama-server |
large pages overflow 32768 ctx at full res | scripts/reproduce_llamacpp_*.sh (llama-server flags) |
Details of the merged #54706 fix: Upstream contributions.
run_manifest.json, metrics.json, environment.json, the lock, commands.txt,
checksums.sha256) so a number is reproducible from recorded inputs — see
docs/release-artifact.md.REPRO.yaml
pins every verified input for the published results — the repo + llama.cpp +
OmniDocBench commits, the GT/model SHA256s, and the HF model/GGUF revisions
and LFS OIDs (cross-checked byte-for-byte against the official repos), the env
versions, and the Overall metric formula. The exact model revisions, LFS OIDs,
and artifact SHA256 values are recorded there as the machine-readable source of
truth, so they are not duplicated here.eval/canary_148.manifest.json
lists the 148 canary pages in file order with the source-GT SHA256.
Regenerate with scripts/create_canary_manifest.py; rebuild the canary subset
byte-identically from the full GT with hunyuan-ocr canary materialize.scripts/reproduce_llamacpp_canary.sh (148) and
scripts/reproduce_llamacpp_full.sh (1651) run predict → validate → score →
verify-manifest against the locked llama.cpp commit, binding 127.0.0.1.
RESUME=1 continues an existing run; OVERWRITE=1 redoes it. Set
LLAMA_DIR/GGUF_DIR/DATA_DIR/OUT_DIR.This repository is mixed-licensed (see NOTICE):
runner.py, validation.py, scoring.py, omnidocbench.py, endpoint_pool.py, preflight.py, canary.py, cli.py, drivers, scripts): Apache-2.0 (LICENSE, LICENSES/Apache-2.0.txt).contract.py, tasks.py, postprocess.py, backends/*): upstream-derived portions under the Tencent Hunyuan Community License (LICENSES/LicenseRef-Tencent-Hunyuan-Community-License.txt) — not Apache.tencent/HunyuanOCR, ggml-org/HunyuanOCR-GGUF): Tencent Hunyuan Community License — not OSI Open Source; excludes EU/UK/KR; "Powered by Tencent Hunyuan" is encouraged, not required.Tencent is not affiliated with, sponsoring, or endorsing this project.
| Backend | Platform | Pages | Overall | Assurance | Status | Result ID |
|---|---|---|---|---|---|---|
| llama-cpp | linux-rocm | 1651 | 92.09 | submitted | valid | hunyuan-ocr__linux-rocm__llama-cpp__bf16__v1-6__9afe77319b08 |
| vllm | linux-rocm | 1651 | 93.64 | evidence-complete | valid | hunyuan-ocr__linux-rocm__vllm__bf16__v1-6__38a99096c23d (primary) |
Generated from
model_card_v2.json(single source of truth). Overall is the raw-evidence-derived value; external/experimental references live indocs/benchmark-context.md.
AIwork4me/HunyuanOCR-ROCm is a public repo on GitHub by AIwork4me. Evaluation-backed AMD ROCm port of HunyuanOCR-1.5 with reproducible OmniDocBench v1.6 benchmarks across llama.cpp, vLLM, and Transformers on gfx1100.
It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-20. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities


A libre lightweight streaming front-end for Android.
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

16 Battle-Tested Visual Designer Prompts for Google Gemini — Transform any text into scroll-stopping infographics
Run Baidu Unlimited-OCR on AMD GPUs at 56 tok/s with zero accuracy loss — one command. Only 16GB VRAM required.

Open-source book: build real products without writing code. One person, one sentence, one product. 12 chapters, 111 tests, deployed demo.
MinerU on AMD ROCm/Windows-HIP — evaluation-backed port. OmniDocBench v1.6: Linux W7900 pipeline 86.48 + VLM 95.56. Windows Strix Halo: pipeline 86.59 verified + VLM llama.cpp HIP 95.46 verified.
Reproducible RDNA reference for Meta Muse-Glimmer-30B — adapting MI-series ROCm recipes to Ryzen AI and Radeon with vLLM, llama.cpp, DFlash and auditable benchmarks.
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/AIwork4me/HunyuanOCR-ROCmTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.