Skip to content

docs: clarify README threading settings and Python model scope - #208

Merged
whoisj merged 2 commits into
triton-inference-server:mainfrom
SiluPanda:docs/fix-pytorch-readme-threading-8853
Sep 1, 2026
Merged

whoisj merged 2 commits into
triton-inference-server:mainfrom
SiluPanda:docs/fix-pytorch-readme-threading-8853

Conversation

@SiluPanda

Copy link
Copy Markdown
Contributor

Summary

  • clarify that the NUM_THREADS, NUM_INTEROP_THREADS, and TORCH_COMPILE_OPTIONAL_PARAMETERS settings are only used when Triton loads a Python model class from model.py
  • point LibTorch / PT2 users to INTER_OP_THREAD_COUNT and INTRA_OP_THREAD_COUNT, which are the CPU-thread parameters handled by the main backend code paths
  • replace the stable TorchScript threading link with the versioned PyTorch 2.8 page that still contains the actual tuning guidance

Refs triton-inference-server/server#8853.

Why

src/model.py consumes NUM_THREADS, NUM_INTEROP_THREADS, and TORCH_COMPILE_OPTIONAL_PARAMETERS, while src/pt/model_state.cc and src/pt2/model_state.cc handle INTER_OP_THREAD_COUNT / INTRA_OP_THREAD_COUNT for serialized TorchScript and PT2 models. The README currently mixes those scopes together and links LibTorch/PT2 thread tuning to a stable PyTorch page that now redirects to a TorchScript deprecation stub.

Validation

  • ran a targeted README validation script to confirm the new section wording and link targets
  • verified that https://docs.pytorch.org/docs/stable/notes/cpu_threading_torchscript_inference.html currently redirects to a 2.13 stub, while https://docs.pytorch.org/docs/2.8/notes/cpu_threading_torchscript_inference.html still contains the full thread-tuning guidance
  • ran pre-commit run --files README.md

@greptile-apps

greptile-apps Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

The README now distinguishes the Python support entrypoint from the native LibTorch and PT2 loaders and clarifies that the Python path may load either a Python class or serialized TorchScript artifact.

  • Directs native LibTorch and PT2 users to INTER_OP_THREAD_COUNT and INTRA_OP_THREAD_COUNT.
  • Explains how compile options apply to batching helpers and Python-defined models.
  • Replaces obsolete stable TorchScript threading links with the PyTorch 2.8 guidance.

Confidence Score: 5/5

The documentation-only change appears safe to merge.

No blocking failure remains; the revised scope now explicitly includes serialized TorchScript models loaded through src/model.py while distinguishing the native loaders.

Important Files Changed

Filename Overview
README.md The revised wording accurately includes serialized model.pt artifacts in the Python support path, resolving the previously reported scope error.

Reviews (2): Last reviewed commit: "docs: fix README scope for Python suppor..." | Re-trigger Greptile

Comment thread README.md Outdated
@whoisj

whoisj commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@SiluPanda, thank you for your contribution. Have you signed the Triton CLA? Unfortunately, I'm not see your GitHub handle in our list of CLA signers, and at this time we cannot accept contributions from individuals who have signed a CLA.

@SiluPanda

Copy link
Copy Markdown
Contributor Author

@whoisj Thank you for the reminder. I’ve now signed and sent the Triton CLA as an individual contributor for @SiluPanda, with N/A for the corporation fields; I’m not representing LinkedIn or any other corporation for this contribution. Please let me know if anything else is needed.

@whoisj
whoisj merged commit 41fd0ec into triton-inference-server:main Sep 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants