Skip to content

fix(settings): disable torch compilation by default on Windows - #3962

Open
art22s wants to merge 1 commit into
docling-project:mainfrom
art22s:fix/3956-disable-torch-compile-on-windows
Open

fix(settings): disable torch compilation by default on Windows#3962
art22s wants to merge 1 commit into
docling-project:mainfrom
art22s:fix/3956-disable-torch-compile-on-windows

Conversation

@art22s

@art22s art22s commented Aug 8, 2026

Copy link
Copy Markdown

Resolves #3956

Summary

  • Disable torch.compile() by default on Windows, where TorchInductor requires an MSVC compiler that may not be installed.
  • Preserve explicit opt-in through DOCLING_INFERENCE_COMPILE_TORCH_MODELS=true and per-engine compile_model=True.
  • Add a regression test covering the Windows default and the environment-variable override.

Testing

  • python3 -m py_compile docling/datamodel/settings.py tests/test_settings_load.py
  • python3 scripts/check_tach_module_coverage.py
  • python3 scripts/check_max_lines.py --max-lines=1500
  • Import smoke: python3 -c "import docling"
  • Not run locally: the repository uv-managed pytest and Ruff checks; uv, pytest, and Ruff are unavailable in this environment.

Checklist

  • Tests added for the behavior change.
  • Documentation is not required for this internal default change.
  • Commit includes the required DCO sign-off.

Signed-off-by: art22s <44128645+art22s@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

DCO Check Passed

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

@mergify

mergify Bot commented Aug 8, 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 Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch.compile requires MSVC on Windows (PyTorch 2.13) causing PDF conversion failure

1 participant