{
  "hf_id": "PaddlePaddle/PaddleOCR-VL",
  "meta": {
    "title": "PaddleOCR-VL",
    "slug": "paddleocr-vl",
    "provider": "PaddlePaddle",
    "description": "PaddleOCR-VL (0.9B) — compact vision-language model for document parsing, OCR, tables, formulas, charts",
    "date_added": "2025-11-04",
    "date_updated": "2026-11-05",
    "tasks": [
      "multimodal"
    ],
    "related_recipes": [],
    "default_variant": {
      "ascend_910b4": "ascend_bf16"
    },
    "hardware": {
      "ascend_910b4": "supported"
    }
  },
  "recommended_command": {
    "hardware": "h200",
    "strategy": "single_node_tp",
    "variant": "default",
    "hub": "huggingface",
    "checkpoint_url": "https://huggingface.co/PaddlePaddle/PaddleOCR-VL",
    "node_count": 1,
    "deploy_type": "single_node",
    "env": {},
    "docker_image": "vllm/vllm-openai:latest",
    "command": "vllm serve PaddlePaddle/PaddleOCR-VL \\\n  --trust-remote-code \\\n  --max-num-batched-tokens 16384 \\\n  --no-enable-prefix-caching \\\n  --mm-processor-cache-gb 0 \\\n  --tensor-parallel-size 1",
    "argv": [
      "vllm",
      "serve",
      "PaddlePaddle/PaddleOCR-VL",
      "--trust-remote-code",
      "--max-num-batched-tokens",
      "16384",
      "--no-enable-prefix-caching",
      "--mm-processor-cache-gb",
      "0",
      "--tensor-parallel-size",
      "1"
    ],
    "docker_command": "docker run --gpus all \\\n  --privileged --ipc=host -p 8000:8000 \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  vllm/vllm-openai:latest PaddlePaddle/PaddleOCR-VL \\\n  --trust-remote-code \\\n  --max-num-batched-tokens 16384 \\\n  --no-enable-prefix-caching \\\n  --mm-processor-cache-gb 0 \\\n  --tensor-parallel-size 1",
    "docker_argv": [
      "docker",
      "run",
      "--gpus",
      "all",
      "--privileged",
      "--ipc=host",
      "-p",
      "8000:8000",
      "-v",
      "~/.cache/huggingface:/root/.cache/huggingface",
      "vllm/vllm-openai:latest",
      "PaddlePaddle/PaddleOCR-VL",
      "--trust-remote-code",
      "--max-num-batched-tokens",
      "16384",
      "--no-enable-prefix-caching",
      "--mm-processor-cache-gb",
      "0",
      "--tensor-parallel-size",
      "1"
    ],
    "strategy_spec": {
      "name": "single_node_tp",
      "deploy_type": "single_node",
      "display_name": "Tensor Parallel",
      "short_label": "TP",
      "orientation": "latency",
      "description": "Single-node tensor parallel. Splits the model across all local GPUs. TP size is set to the GPU count at deploy time. The simplest multi-GPU strategy — works for all model architectures.\n",
      "hardware_match": {
        "min_gpus": 1,
        "max_gpus": 8,
        "multi_node": false
      },
      "vllm_args": [],
      "parallel_flag": "--tensor-parallel-size"
    },
    "hardware_profile": {
      "brand": "NVIDIA",
      "generation": "hopper",
      "compute_arch": "sm90",
      "display_name": "H200",
      "description": "NVIDIA H200 SXM 141 GB HBM3e · 8-GPU HGX node",
      "gpu_count": 8,
      "vram_gb": 1128,
      "multi_node": false
    },
    "alternatives": {
      "multi_node_tp": "/PaddlePaddle/PaddleOCR-VL/strategies/multi_node_tp.json",
      "kv_store_centralized_mooncake": "/PaddlePaddle/PaddleOCR-VL/strategies/kv_store_centralized_mooncake.json",
      "kv_store_distributed_mooncake": "/PaddlePaddle/PaddleOCR-VL/strategies/kv_store_distributed_mooncake.json"
    },
    "by_hardware": {
      "h200": "/PaddlePaddle/PaddleOCR-VL/hw/h200.json",
      "h100": "/PaddlePaddle/PaddleOCR-VL/hw/h100.json",
      "b200": "/PaddlePaddle/PaddleOCR-VL/hw/b200.json",
      "gb200": "/PaddlePaddle/PaddleOCR-VL/hw/gb200.json",
      "b300": "/PaddlePaddle/PaddleOCR-VL/hw/b300.json",
      "gb300": "/PaddlePaddle/PaddleOCR-VL/hw/gb300.json",
      "mi300x": "/PaddlePaddle/PaddleOCR-VL/hw/mi300x.json",
      "mi325x": "/PaddlePaddle/PaddleOCR-VL/hw/mi325x.json",
      "mi350x": "/PaddlePaddle/PaddleOCR-VL/hw/mi350x.json",
      "mi355x": "/PaddlePaddle/PaddleOCR-VL/hw/mi355x.json",
      "ascend_910b4": "/PaddlePaddle/PaddleOCR-VL/hw/ascend_910b4.json"
    }
  },
  "model": {
    "model_id": "PaddlePaddle/PaddleOCR-VL",
    "min_vllm_version": "0.11.1",
    "architecture": "dense",
    "parameter_count": "0.9B",
    "active_parameters": "0.9B",
    "context_length": 131072,
    "base_args": [
      "--trust-remote-code",
      "--max-num-batched-tokens",
      "16384",
      "--no-enable-prefix-caching",
      "--mm-processor-cache-gb",
      "0"
    ],
    "base_env": {},
    "install": {
      "pip": {
        "command": "uv venv\nsource .venv/bin/activate\nuv pip install -U vllm --torch-backend auto"
      },
      "docker": {
        "command": "docker pull vllm/vllm-openai:latest"
      },
      "extras": [
        {
          "note": "PaddlePaddle runtime (install in a separate venv from vllm to avoid conflicts)",
          "command": "uv pip install paddlepaddle-gpu==3.2.1 --extra-index-url https://www.paddlepaddle.org.cn/packages/stable/cu126/",
          "optional": true,
          "brand": "NVIDIA"
        },
        {
          "note": "PaddleOCR document-parsing helpers",
          "command": "uv pip install \"paddleocr[doc-parser]==3.3.2\"",
          "optional": true
        },
        {
          "note": "Safetensors loader used by the doc-parser path",
          "command": "uv pip install safetensors",
          "optional": true
        }
      ]
    }
  },
  "features": {
    "text_only": {
      "description": "Skip loading the vision encoder for text-only workloads — frees VRAM for KV cache. Mutually exclusive with encoder_parallel.",
      "args": [
        "--language-model-only"
      ]
    },
    "encoder_parallel": {
      "description": "Run the vision encoder in data-parallel mode — avoids TP comm overhead on the small encoder. Mutually exclusive with text_only.",
      "args": [
        "--mm-encoder-tp-mode",
        "data"
      ]
    }
  },
  "opt_in_features": [
    "text_only",
    "encoder_parallel"
  ],
  "variants": {
    "default": {
      "precision": "bf16",
      "vram_minimum_gb": 2,
      "description": "BF16 weights — small footprint, runs on most GPUs"
    },
    "ascend_bf16": {
      "precision": "bf16",
      "tp": 1,
      "label": "BF16 · Ascend A2 graph",
      "vram_minimum_gb": 3,
      "description": "Pinned 0.9B BF16 graph configuration on one Ascend 910B4 (32 GB HBM). Historical 910B3 evidence is documented separately; stable 910B3 serving is not claimed. Context uses the checkpoint default; 16384 is the batch-token budget. Long-context inputs are not validated.",
      "supported_hardware": [
        "ascend_910b4"
      ],
      "hardware_overrides": {
        "ascend_910b4": {
          "docker_image": "quay.io/ascend/vllm-ascend:v0.30.0@sha256:28351d337b7f9367073344240fa4e28d99794d549d577eaf317689950064150a",
          "docker_serve_command": "vllm serve",
          "install": {
            "pip": false,
            "docker": true
          },
          "extra_args": [
            "--dtype",
            "bfloat16",
            "--max-num-batched-tokens",
            "16384",
            "--gpu-memory-utilization",
            "0.80",
            "--served-model-name",
            "PaddlePaddle/PaddleOCR-VL",
            "PaddleOCR-VL-0.9B",
            "--additional-config",
            "{\"enable_cpu_binding\":true}",
            "--compilation-config",
            "{\"cudagraph_mode\":\"FULL_DECODE_ONLY\"}"
          ],
          "extra_env": {
            "VLLM_USE_MODELSCOPE": "True",
            "TASK_QUEUE_ENABLE": "0",
            "CPU_AFFINITY_CONF": "1",
            "PYTORCH_NPU_ALLOC_CONF": "expandable_segments:True"
          }
        }
      }
    }
  },
  "kv_offload_support": {
    "offloading_cpu": "verified",
    "offloading_fs": "verified"
  },
  "hardware_overrides": {
    "amd": {
      "extra_args": [],
      "extra_env": {
        "SAFETENSORS_FAST_GPU": "1"
      }
    }
  },
  "guide": "## Overview\n\n[PaddleOCR-VL](https://huggingface.co/PaddlePaddle/PaddleOCR-VL) is a SOTA resource-efficient\nmodel for document parsing. Its core (PaddleOCR-VL-0.9B) combines a NaViT-style dynamic\nresolution visual encoder with an ERNIE-4.5-0.3B language model, optimized for OCR,\ntables, formulas, and chart recognition.\n\n## Prerequisites\n\n- Hardware: one compatible accelerator; see the platform-specific requirements below\n- vLLM >= 0.11.1\n- AMD ROCm wheels require Python 3.12, ROCm 7.2.3, and glibc >= 2.35.\n\nOCR workloads do not benefit much from prefix caching or image reuse, so the\nserving configuration disables those caches.\n\n## Client Usage\n\nTask-specific prompts:\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(api_key=\"EMPTY\", base_url=\"http://localhost:8000/v1\", timeout=3600)\n\nTASKS = {\n    \"ocr\": \"OCR:\",\n    \"table\": \"Table Recognition:\",\n    \"formula\": \"Formula Recognition:\",\n    \"chart\": \"Chart Recognition:\",\n}\n\nresponse = client.chat.completions.create(\n    model=\"PaddlePaddle/PaddleOCR-VL\",\n    messages=[{\n        \"role\": \"user\",\n        \"content\": [\n            {\"type\": \"image_url\", \"image_url\": {\"url\": \"https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/paddleocr_vl_demo.png\"}},\n            {\"type\": \"text\", \"text\": TASKS[\"ocr\"]},\n        ],\n    }],\n    temperature=0.0,\n)\nprint(response.choices[0].message.content)\n```\n\n## Offline Inference with PP-DocLayoutV2 (NVIDIA GPU)\n\nUse separate venvs for `vllm` and `paddlepaddle` to avoid conflicts. If you see\n\"The model PaddleOCR-VL-0.9B does not exist.\", serve both client aliases with `--served-model-name PaddlePaddle/PaddleOCR-VL PaddleOCR-VL-0.9B`.\n\n```bash\nuv pip install paddlepaddle-gpu==3.2.1 --extra-index-url https://www.paddlepaddle.org.cn/packages/stable/cu126/\nuv pip install \"paddleocr[doc-parser]==3.3.2\"\nuv pip install safetensors\n```\n\n```python\nfrom paddleocr import PaddleOCRVL\n\npipeline = PaddleOCRVL(\n    vl_rec_backend=\"vllm-server\",\n    vl_rec_server_url=\"http://localhost:8000/v1\",\n    layout_detection_model_name=\"PP-DocLayoutV2\",\n    layout_detection_model_dir=\"/path/to/your/PP-DocLayoutV2/\",\n)\n\noutput = pipeline.predict(\"https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/paddleocr_vl_demo.png\")\nfor i, res in enumerate(output):\n    res.save_to_json(save_path=f\"output_{i}.json\")\n    res.save_to_markdown(save_path=f\"output_{i}.md\")\n```\n\n## Ascend A2 support and version scope\n\nThe selected hardware profile is `ascend_910b4`: a single Ascend 910B4\nwith 32 GB HBM, rather than the shared eight-NPU `ascend_910b` node profile.\nThe BF16 graph variant is restricted to this one-NPU profile and uses the\npinned v0.30.0 image. The historical A2 tutorial also covers 910B3,\nbut stable 910B3 serving is not validated by this configuration.\nThe current Ascend tutorial discontinues model support from v0.30.0.\nThe 910B4 stable functional run passed recognition and document parsing.\nIts shutdown logs showed an EngineDeadError, forced EngineCore termination\nand a semaphore warning. Stable 910B3 testing remains unverified.\n\n### A2 source-tutorial scenarios\n\nThe source tutorial also documents A2 single-NPU graph serving (BF16,\n`--max-num-batched-tokens 16384`) and a separate Paddle custom-NPU layout pipeline.\nOn 2026-10-13, a dedicated A2 environment (actual Ascend 910B3, CANN 9.1.0)\npassed all four tasks with both model aliases in BF16 graph mode and a separate\nnative Paddle custom-NPU newspaper pipeline (31 blocks, clean exit). The tested\nsettings use `TASK_QUEUE_ENABLE=0` and `--gpu-memory-utilization 0.80`; the\ntutorial defaults failed startup on this image. Paddle layout uses its separate\nCANN 8.0 image, genuine compatible compiler dependencies, ABI 0 ATB libraries,\nand the standard-library path before forkserver workers. These settings and\nevidence are maintained in the bilingual Ascend recipe. These historical results cover the single-NPU 910B3 profile. The current-main 910B4 supplement is recorded separately below; 910B2 remains unverified.\nThe companion [Ascend recipe PR](https://github.com/vllm-ascend/vllm-ascend-recipes/pull/101)\nalso records the completed original 1355-page A2 run: Overall 92.4426% using\nunchanged official ED/TEDS/rendered CDM metrics, with page batch 16 and\npreprocessing queues disabled. Renderer failures and truncated predictions\nare retained. This is separate from the 310P profile and does not establish\nmatched performance or formal acceptance. 910B2, long-context inputs,\nnative Docker launch on 310P and nightly CI remain untested.\n\nThe companion Ascend recipe PR was merged on 2026-10-22. Its\n[A2 PR verification run #427](https://github.com/vllm-ascend/vllm-ascend-recipes/actions/runs/39742255957)\ncompleted real inference on the `v0.30.0rc2` A2 image: four hash-checked sample\ndownloads and all eight recognition checks (four tasks under both aliases) passed.\nThis A2 result does not validate the replacement `v0.30.0rc2-310p` image or\nreplace the full-dataset accuracy and performance evidence above.\nMulti-node PD is not supported by this tutorial.\n\n### Current-main A2 supplement on 910B4\n\nHiDevLab allocated a single 910B4 with 32 GB HBM on 2026-11-06, rather than\nthe historical 64 GB 910B3. The dedicated `ascend_910b4` profile retains the\ntested BF16 graph/TP1, batch 16384 and memory-utilization 0.80 settings; the\ncheckpoint default context is not replaced by a 16384-token context cap.\nThe exposed physical device was davinci3, mapped to logical NPU 0 by this\nenvironment. This does not validate 910B3, 910B2 or long-context inputs.\n\nNative current-main serving used driver 25.5.2, CANN 9.2.1, Python 3.12.16,\nvLLM source `5df63a7203cdb9328d824a27b682e77c7b9928be` and Ascend source\n`d96c01e5c2266d6df061311e8966e096bc542f68`, with clean tracked trees.\nOriginal recognition weights and every model file match the previous frozen\nbaseline. Sixteen requests passed: both aliases, four tasks and one warmup\nplus one measured round. Content and stop reasons were checked. Startup,\ninference and explicit frontend shutdown passed the ERROR/Traceback audit.\n\nAfter the full-data run below, a separate fresh service also passed the\nexact published remote-URL document command with page batch 16 and native\nNPU layout. It produced 31 blocks with checked content/bounds/JSON/Markdown;\nall 27 recognition requests returned HTTP 200. Server and client logs\npassed both ERROR/Traceback and case-insensitive error/exception/traceback\nscans. The frontend exited with code 0 without a forced kill. All original\nrecognition model files and tracked native source trees were rechecked\nafter these runs and remained identical; no task/NPU processes remained.\n\nThe exact shared document parser also passed the official PNG and the frozen\none-page PDF: both returned 31 layout blocks with checked content, bounds,\nJSON and Markdown. All 55 recognition HTTP calls returned 200; server and\nclient log audits passed. Layout used the complete pinned CANN 8.0 image\nbelow under PRoot 5.5.0, all blobs independently SHA256-verified, with\nhost-visible compiler paths and separate Paddle 3.2.0/custom-NPU 3.2.0,\nPaddleOCR 3.3.2 and PaddleX 3.3.13. No driver or model code was changed.\n\nThe main registry tag resolved to index\n`sha256:4b537a90f25f7d282927b49f474f9d8ecf61fd0bf556c28e9ec1ac54d48371c3`,\nwhich was the previous 910B4 builder pin. The platform did not expose the native\ncontainer image ID, so that lookup is recorded separately from its measured\nsource/package identity. No normal Docker CLI launch or future-main support\nis claimed. Metadata remains supported rather than verified. Generated\nDocker examples assume a host exposing `/dev/davinci0`; the native HiDevLab\nrun used its exposed `/dev/davinci3` and does not validate that Docker device\nbinding.\n\n\nAll 1355 unchanged original OmniDocBench v1.5 images then produced Markdown:\n25888 HTTP 200 responses, 25873 stop and 15 length-limited outputs. One empty\nMarkdown and all truncated outputs remain in evaluation. Prediction plus\nMarkdown/crop saving took 4634.496337 seconds, or 3.42029250 seconds per\noriginal image; initialization (39.96218 seconds) and cleanup were excluded.\nPage batch 16, queues disabled, layout batch 8, VLRec batch 4096, temperature\n0, output cap 4096 and no external warmup were used. The server restarted\nafter the pilot; compiler/filesystem caches may persist. The local API audit\nhop and progress output are included in timing. All inference/client logs\npassed the case-insensitive error/exception/traceback scan.\n\nThe unchanged official evaluator at the commit above, with fresh render\ncaches and two CDM workers, exited normally: text edit distance\n0.04415666895, table TEDS 0.90661323468, formula CDM\n0.91141464103, Overall 92.46237356%. The frozen ModelZoo\ncomponent-rounding calculation gives 92.46733333%.\nAll 1054 formula pairs, including 13 zero scores and all renderer/tokenizer\nfailures, are retained. Evaluation used 2 GiB/no-swap/two CPUs, recorded\ncgroup peak 1398452224 bytes and zero OOM events. This is the measured native\n910B4 graph result, separate from 310P, historical 910B3 and untested 910B2.\nThe linked official reference publishes no separate A2 numeric target; that\nnumeric comparison is N/A, with these measurements retained. It does not\nestablish matched-reference performance or formal acceptance.\n\nFull-run host sampling reached 34359693312 bytes including image-preparation\nfile cache, with sampled limit-hit delta 87720 and zero OOM kills; this is\nnot pure inference RSS. HBM sampling reached 31519 of 32768 reported MB,\nwith 235 successful full-phase samples and no sampler errors. The timeline\nstarted before service startup; exact transient peaks are not claimed.\n\n### Ascend references\n\n- [Pinned Ascend tutorial](https://github.com/vllm-project/vllm-ascend/blob/0830899b4e3f55ea6ed9f3518385e9d81192ae29/docs/source/tutorials/models/PaddleOCR-VL.md)\n- [ModelZoo OM integration and evaluation](https://gitcode.com/Ascend/ModelZoo-PyTorch/tree/e779117e8cfeba296a7105e26adac0741ab04768/ACL_PyTorch/built-in/ocr/PP-DocLayoutV2)\n- [OmniDocBench v1.5](https://huggingface.co/datasets/opendatalab/OmniDocBench/tree/v1_5)\n- [Official ModelScope demonstration assets (same SHA256 required)](https://modelscope.cn/datasets/PaddlePaddle/PaddleOCR-VL_demo)\n- [Pinned Hugging Face demonstration assets](https://huggingface.co/datasets/PaddlePaddle/PaddleOCR-VL_demo/tree/702b96b0a06740b0ed3d41ba382a5bf69986dcae/imgs)\n\n### A2 document parsing with native Paddle NPU layout\n\nPP-DocLayoutV2 uses Paddle custom-NPU on A2 and must remain separate from the vLLM environment. The historical run used a real 910B3; it does not validate 910B2. The following immutable CANN 8.0 layout image preserves that compiler/runtime boundary.\n\n```bash\nexport IMAGE=ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-npu:cann800-ubuntu20-npu-910b-base-aarch64-gcc84@sha256:9bbc08c1bed9c064f0775da4a7bd1c857fa33d0d51bcd705e6829f4cbcf86911\ndocker run --rm -it --name paddleocr-layout-a2 --net=host --shm-size=1g \\\n    --device /dev/davinci0 --device /dev/davinci_manager \\\n    --device /dev/devmm_svm --device /dev/hisi_hdc \\\n    -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro \\\n    -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \\\n    -v /usr/local/dcmi:/usr/local/dcmi -v \"$PWD\":/work -w /work \\\n    -e ASCEND_RT_VISIBLE_DEVICES=0 \"$IMAGE\" bash\n# Inside the Paddle container (Python 3.10, aarch64):\nsource /usr/local/Ascend/ascend-toolkit/set_env.sh\nsource /usr/local/Ascend/nnal/atb/set_env.sh --cxx_abi=0\npython -m pip install 'numpy<2' 'setuptools<81' 'protobuf==3.20.3' decorator sympy scipy attrs psutil paddlepaddle==3.2.0\npython -m pip install https://paddle-whl.bj.bcebos.com/stable/npu/paddle-custom-npu/paddle_custom_npu-3.2.0-cp310-cp310-linux_aarch64.whl\npython -m pip install 'paddleocr[doc-parser]==3.3.2' safetensors modelscope\npython - <<'PY'\nimport sys\nimport sysconfig\nimport paddle\n\nsys.path.insert(0, sysconfig.get_path('stdlib'))\nassert 'npu' in paddle.device.get_all_custom_device_type()\npaddle.utils.run_check()\nPY\nmodelscope download --model PaddlePaddle/PP-DocLayoutV2 --local_dir PP-DocLayoutV2\n```\n\nSave the following previously verified shared parser as `parse_document.py` in the layout environment. Run it with `--layout-device npu` for A2.\n\n```python\nimport argparse\nimport json\nimport time\nfrom pathlib import Path\n\nfrom paddleocr import PaddleOCRVL\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--input', required=True)\nparser.add_argument('--layout-model', type=Path, required=True)\nparser.add_argument('--output', type=Path, default=Path('document-output'))\nparser.add_argument('--server-url', default='http://127.0.0.1:8000/v1')\nparser.add_argument('--layout-device', choices=['cpu', 'npu'], default='cpu')\nparser.add_argument('--page-batch-size', type=int, default=16)\nargs = parser.parse_args()\nif args.layout_device == 'npu':\n    # OpenCV adds its package directory; CANN compiler workers need stdlib first.\n    import sys\n    import sysconfig\n    sys.path.insert(0, sysconfig.get_path('stdlib'))\nif args.layout_device == 'cpu':\n    # CPU Paddle preprocessing + the ModelZoo-patched ACL InferSession(0).\n    # PP-DocLayoutV2 still runs on NPU; Paddle custom-NPU is not used on 310P.\n    assert (args.layout_model / 'inference_linux_aarch64.om').is_file(), 'Compile the aarch64 OM model first'\n# Bound queued page images on the tested 32 GiB A2 host.\n# Preserve every other official pipeline setting, including layout batches.\nfrom paddlex.inference import load_pipeline_config\nassert args.page_batch_size > 0\nconfig = load_pipeline_config('PaddleOCR-VL')\nconfig['batch_size'] = args.page_batch_size\nconfig['use_queues'] = False\npipeline = PaddleOCRVL(\n    paddlex_config=config,\n    vl_rec_backend='vllm-server',\n    vl_rec_server_url=args.server_url,\n    layout_detection_model_name='PP-DocLayoutV2',\n    layout_detection_model_dir=str(args.layout_model),\n    use_doc_orientation_classify=False,\n    use_doc_unwarping=False,\n    device=args.layout_device,\n)\nargs.output.mkdir(parents=True, exist_ok=True)\nstart = time.perf_counter()\ncount = 0\ntry:\n    for result in pipeline.predict_iter(args.input):\n        result.save_to_json(str(args.output))\n        result.save_to_markdown(str(args.output))\n        count += 1\n    elapsed = time.perf_counter() - start\nfinally:\n    pipeline.close()\n    if args.layout_device == 'cpu':\n        from ais_bench.infer.interface import InferSession\n        pipeline.paddlex_pipeline.layout_det_model.om_sess.free_resource()\n        InferSession.finalize()\nassert count > 0, 'No pages parsed'\nassert list(args.output.glob('*.md')), 'No Markdown output'\nassert list(args.output.glob('*.json')), 'No JSON output'\n(args.output / 'timing.json').write_text(json.dumps({'pages': count, 'seconds': elapsed, 'seconds_per_page': elapsed / count, 'scope': 'pipeline prediction only; excludes pipeline initialization', 'layout_device': args.layout_device, 'page_batch_size': args.page_batch_size, 'use_queues': config['use_queues']}, indent=2) + '\\n')\nprint(f'Parsed {count} page(s) in {elapsed:.3f}s')\n```\n\nRun the parser with the native A2 layout device:\n\n```bash\npython parse_document.py --input https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/paddleocr_vl_demo.png --layout-model PP-DocLayoutV2 --layout-device npu --page-batch-size 16 --server-url http://127.0.0.1:8000/v1 --output document-output\n```\n\nThe A2 layout path uses 16-page batches with preprocessing queues disabled on a 32 GiB host. Earlier queue-enabled A2 attempts hit that quota; their failures remain recorded. This memory setting changes the document-processing configuration and must be included in timing comparisons. It does not change Golden annotations or metric definitions.\n\n### Accuracy and performance acceptance boundaries\n\nThe historical tutorial delegates accuracy and performance to the [ModelZoo PP-DocLayoutV2 guide](https://gitcode.com/Ascend/ModelZoo-PyTorch/tree/master/ACL_PyTorch/built-in/ocr/PP-DocLayoutV2). Its published 300I DUO single-chip reference is Overall 92.43%, a cited official 92.86%, and performance 12.10 seconds per input file. Its test.py starts timing after pipeline initialization, includes prediction and Markdown saving, and divides elapsed time by the original input-file count. PDFs may contain several pages per file. These are reference values, not new measurements. Warmup, concurrency, token limits and the permitted accuracy tolerance are not fully specified by the reference table. No A2-specific numeric target is published there.\n\nUse unchanged OmniDocBench v1.5 inputs and annotations and evaluator commit 523fd1d529c3e9d0088c662e983aa70fb9585c9a. Compute original text edit distance, table TEDS and rendered formula CDM; retain empty/truncated outputs and renderer failures. Keep model, layout model, precision, image digest, page/region batching, queues, concurrency, token cap, warmup, timing scope and peak memory with each result. The historical 1355-page scores belong to their recorded old images and are not replacement-image acceptance evidence.\n\n## References\n\n- [PaddleOCR-VL on Hugging Face](https://huggingface.co/PaddlePaddle/PaddleOCR-VL)\n- [PaddleOCR GitHub](https://github.com/PaddlePaddle/PaddleOCR)\n",
  "strategy_hardware": {
    "multi_node_tp": {
      "ascend_910b4": "unsupported"
    }
  },
  "source": {
    "source": "vllm",
    "repo": "vllm-project/vllm",
    "ref": "main",
    "sha": "0e8c5f622f138bdce14a917572e3f48e2311c927",
    "path": "recipes/models/PaddlePaddle/PaddleOCR-VL.yaml",
    "edit_url": "https://github.com/vllm-project/vllm/edit/main/recipes/models/PaddlePaddle/PaddleOCR-VL.yaml",
    "overlays": [
      {
        "source": "vllm-ascend",
        "repo": "vllm-project/vllm-ascend",
        "ref": "main",
        "sha": "e4580829dd97eaa587af00172a367cec52e00606",
        "path": "recipes/overlays/PaddlePaddle/PaddleOCR-VL.yaml",
        "edit_url": "https://github.com/vllm-project/vllm-ascend/edit/main/recipes/overlays/PaddlePaddle/PaddleOCR-VL.yaml"
      }
    ]
  }
}