Skip to content

feat(vlm): add native MLX support for Nemotron 3.5 Parse - #4934

Open
geoHeil wants to merge 7 commits into
docling-project:mainfrom
geoHeil:feat/nemotron-3-5-mlx
Open

geoHeil wants to merge 7 commits into
docling-project:mainfrom
geoHeil:feat/nemotron-3-5-mlx

Conversation

@geoHeil

@geoHeil geoHeil commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Enable the native MLX engine for nemotron_parse_v3_5. Auto-inline selects MLX on Apple Silicon only when the installed package contains the native model module and meets the preset's engine requirement. Otherwise it selects Transformers, including on CUDA. Explicit MLX selection reports a missing module before it downloads weights.

Closes #4932.

Native MLX requires mlx-vlm 0.7.11 or later and the native model module. The preset sets min_engine_version="0.7.11". The native port is merged upstream in mlx-vlm #2562. pyproject.toml and uv.lock match main.

The MLX preset pins the published bf16 checkpoint. The 8-bit and 4-bit checkpoints remain available. It uses the existing Nemotron output mapper and needs no Hugging Face remote code. Explicit engine options override the preset's full-history repetition penalty settings.

Validation after rebase onto main 90234a71:

  • Focused MLX, Nemotron, preset, conversion, and API-usage suites after the minimum-version correction: 102 passed, 3 skipped with released dependencies; 104 passed, 1 skipped with merged upstream MLX source. The remaining native-environment skip is the existing legacy PictureDescription preset check.
  • Regression cases reject 0.7.9 and 0.7.10 even with the native module. Version 0.7.11 selects MLX only with the module. Explicit MLX rejects 0.7.10 before model download and loads the pinned export with 0.7.11. Three boundary cases failed before the minimum-version correction and pass after it.
  • make validate, hooks on all changed files, and commit hooks passed. No reference data changed.
  • All three workspace packages built as wheels and source distributions with uv build --all-packages --no-sources. All six artifacts contain no direct dependency URLs.
  • Hosted CI passed on edadefc2. All 27 reported checks passed, including documentation, package tests, and Codecov patch coverage. Six workflow-configured checks were skipped.

Earlier local fidelity report and reproduction commands: float32 matched the full Transformers output on the three checked pages. Reduced precision changed coordinates and some text/classes. These are limited fidelity samples, not accuracy scores. The port uses greedy decoding without MTP. Those full-model runs were not repeated for this dependency/documentation update.

@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @geoHeil, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@geoHeil

geoHeil commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

GPT-6.1 Sol review at final Docling head b93c1c46169d430baf073a5ef6931123c41b2109: no code blocker remains. The live head and draft state are confirmed.

The production follow-up fixes both hosted findings. Auto-inline checks the native module and falls back to Transformers when the installed release lacks the port. Explicit MLX gives a clear error before downloading weights. Shipped dependencies use a normal version range; all six built wheel/sdist artifacts contain no direct dependency URLs. The signed Git pin is confined to development sources.

Independent production tests: 117 passed, one existing skip. Final broader local tests: 128 passed, one existing skip. Independent final tests: 126 passed, two skipped, one deselected. The nested review runtime could not run one unchanged native-import test; the root run includes it. make validate and commit hooks passed. Read-only make check stops at 17 unchanged oversized base files; the other checks passed. The final commit adds only portable tests for vLLM version selection and explicit MLX loading.

Final-head hosted CI: 46 checks passed, seven configured skips, no pending or failed checks. Codecov patch coverage is 100%, with 28 covered lines, no missed lines, and no partial lines.

The real bf16 conversion was repeated after the selection fix. It checks table cells, document ownership, provenance, JSON, Markdown, and HTML. Native source 398153fa9d0ca62e7e3761eef46362348104d628 has the same tree as the measured source; its GitHub signature is verified.

All three public HF models were uploaded, downloaded, and reloaded locally. Report and reproduction commands. Float32 output is exact on the three checked pages. Reduced precision changes coordinates, some text, and classes. This local evidence does not run in CI.

All hosted review threads are resolved. The PR stays draft, open, and unmerged until the upstream MLX port is released and the development pin can be replaced.

@geoHeil
geoHeil marked this pull request as ready for review October 21, 2026 11:35
@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI dependency mgmt enhancement New feature or request vlm-pipeline labels Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit edadefc202. The analysis read the diff only. It did not run code from this pull request.

This pull request adds native MLX engine support for the Nemotron 3.5 Parse model preset. It also adds a check for required native model modules during engine selection.

CI safety: no concern found. A maintainer must still approve CI.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI first review (advisory): no blocker found

This review covers the full diff at ac187acdfc. It read the code and did not run it.

The MLX preset depends on a personal fork of mlx-vlm that is pinned by commit. The version gate cannot detect the missing port. Decide whether the fork pin may merge to the base branch. If it may, decide how auto-inline avoids choosing MLX on an mlx-vlm that lacks the port.

A maintainer makes the merge decision. This review never approves the pull request.

Comment thread docling/datamodel/stage_model_specs.py Outdated
Comment thread pyproject.toml Outdated
@github-actions github-actions Bot added ai:review-lgtm AI first review found no blocker or major issue (advisory) ai:ci-needs-care AI triage: check CI-safety findings before you approve CI and removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI ai:review-lgtm AI first review found no blocker or major issue (advisory) labels Oct 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI first review (advisory): no blocker found

This review covers the changes since ac187acdfc at 3403bd736a. It read the code and did not run it.

The two earlier blockers are fixed: the version gate now checks the native module via engine_module_available, and the shipped extra keeps a version range (mlx-vlm>=0.7.9,<1.0.0), not a git URL. The [tool.uv.sources] git pin for the personal fork is still present and the PR description explicitly asks maintainers not to merge until upstream accepts the port. There are no code defects in the new logic.

Earlier findings

  • fixed (question): Version gate does not detect an mlx-vlm without the Nemotron port
  • answered (question): Fork source pin in a shipped extra, with allow-direct-references

A maintainer makes the merge decision. This review never approves the pull request.

Comment thread pyproject.toml Outdated
@github-actions github-actions Bot added the ai:review-lgtm AI first review found no blocker or major issue (advisory) label Oct 21, 2026
@geoHeil
geoHeil marked this pull request as draft October 21, 2026 11:58
@github-actions github-actions Bot removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI ai:review-lgtm AI first review found no blocker or major issue (advisory) labels Oct 21, 2026
@geoHeil

geoHeil commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

yes this is meant to wait a bit and then decide; it looks like upstream is receptive - they addressed my PR/reviewed it today. givve it a bit of time

@geoHeil

geoHeil commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Blaizzy/mlx-vlm#2562 is merged upstream now - once the next release is out we can continue here. so newer than (>= 0.7.10) should be workign then

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
…upport

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
@geoHeil
geoHeil force-pushed the feat/nemotron-3-5-mlx branch from b93c1c4 to 708edd7 Compare October 25, 2026 11:31
@geoHeil
geoHeil marked this pull request as ready for review October 25, 2026 11:31
@github-actions github-actions Bot added the ai:ci-safe AI triage found no CI-safety concern (advisory) label Oct 25, 2026
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
@github-actions github-actions Bot added ai:ci-safe AI triage found no CI-safety concern (advisory) and removed ai:ci-safe AI triage found no CI-safety concern (advisory) labels Oct 25, 2026
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
@github-actions github-actions Bot removed the ai:ci-safe AI triage found no CI-safety concern (advisory) label Oct 25, 2026
Comment on lines +64 to +68
model module is installed with `mlx-vlm` 0.7.11 or later. Otherwise,
auto-inline falls back to Transformers. MLX uses a
pinned `geoHeil/Nemotron-3.5-Parse-MLX-bf16` checkpoint and does not require
remote model code. On CUDA it selects Transformers, which runs code from its
model repository at a pinned revision. That engine requires

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upstream is already merged, we only wait for a release

@geoHeil
geoHeil requested a review from cau-git October 25, 2026 11:45
@github-actions github-actions Bot added the ai:ci-safe AI triage found no CI-safety concern (advisory) label Oct 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:ci-safe AI triage found no CI-safety concern (advisory) dependency mgmt enhancement New feature or request vlm-pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(vlm): MLX engine for Nemotron-3.5-Parse

1 participant