Skip to content

Inaccuracies in PyTorch backend documentation #8853

Open

Description

@kpedro88

triton-inference-server/pytorch_backend#117 introduced a Python-based backend for PyTorch 2.0 (model.py). If you look at the state of the README in that PR, there is a section "Customizations" that only applies to model.py, not libtorch or other PyTorch backends.

More recently, triton-inference-server/pytorch_backend#160 and triton-inference-server/pytorch_backend#164 changed the documentation. All mentions of model.py are removed (except for one leftover at the very bottom of the README). The "Customizations" section for model.py is now just part of the overall "Configuration" section, but this is incorrect. The actual thread control parameters for the libtorch backend are INTER_OP_THREAD_COUNT and INTRA_OP_THREAD_COUNT, as listed earlier in the "Parameters" section.

There is also a broken link related to this topic:

[!TIP] Refer to CPU Threading TorchScript on how to set this parameter properly.

The page https://pytorch.org/docs/stable/notes/cpu_threading_torchscript_inference.html now just says "TorchScript is deprecated, please use torch.export instead."

This is unfortunate, because there seems to be no adequate replacement (I can only find https://docs.pytorch.org/docs/2.12/notes/multiprocessing.html#avoid-cpu-oversubscription, which is not nearly as thorough). Perhaps linking to the previous version of the page, https://docs.pytorch.org/docs/2.8/notes/cpu_threading_torchscript_inference.html, is the right choice.

Tagging experts here: @whoisj @kthui @yinggeh

(I am not sure of the right way to fix this, because it depends on the status and outlook for the Python backend.)

Activity

  1. whoisj commented on Jul 1, 2026

    @whoisj
    Contributor

    Thank you for bringing this to our attention @kpedro88. We'll try and get the docs updated in time for our 26.07 release of Triton Server.

  2. added
    documentation issueDocumentation isn't correct or could be improved
    DocumentationImprovements or additions to documentation (docs: PRs)
    on Jul 1, 2026
  3. SiluPanda commented on Aug 30, 2026

    @SiluPanda

    Opened a fix in the backend repo here: triton-inference-server/pytorch_backend#208. It clarifies that NUM_THREADS / NUM_INTEROP_THREADS / TORCH_COMPILE_OPTIONAL_PARAMETERS are model.py-only settings, points LibTorch/PT2 users to INTER_OP_THREAD_COUNT / INTRA_OP_THREAD_COUNT, and updates the TorchScript threading reference to the versioned PyTorch 2.8 guide.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationImprovements or additions to documentation (docs: PRs)documentation issueDocumentation isn't correct or could be improved

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions