Skip to content

Introduce inference: block to pytorch_config.yaml#3104

Closed
maximpavliv wants to merge 4 commits intomainfrom
maxim/inference_config
Closed

Introduce inference: block to pytorch_config.yaml#3104
maximpavliv wants to merge 4 commits intomainfrom
maxim/inference_config

Conversation

@maximpavliv
Copy link
Copy Markdown
Contributor

@maximpavliv maximpavliv commented Sep 23, 2025

Main changes:

  • Introduced MultithreadingConfig and InferenceConfig dataclasses, including from_dict and to_dict helper methods for convenient YAML and dict conversion.

  • Updated InferenceRunner (and its child classes) to accept an InferenceConfig object instead of separate multithreading arguments.

  • Added an inference: block with default multithreading values to pytorch_config.yaml when it is created.

    • If the inference block is missing in an existing config, default values are used to maintain backwards compatibility.

Notes:

  • Currently, only the multithreading parameters are included in this PR.

  • Configuration for torch.compile and torch.autocast will be added in future PRs.

@arashsm79
Copy link
Copy Markdown
Contributor

arashsm79 commented Oct 1, 2025

Works great on new projects.
For pytorch_confing.yaml files in older projects without this part, it just uses the defaults.
LGTM.

@MMathisLab
Copy link
Copy Markdown
Member

Any issues with compat on older TF projects, no right?

@maximpavliv
Copy link
Copy Markdown
Contributor Author

@MMathisLab no, this doesn't introduce any chances on the TF-backend part.

This PR no longer has any diffs against main because its commits were included in #3105. Closing as redundant.

@maximpavliv maximpavliv closed this Oct 1, 2025
@arashsm79
Copy link
Copy Markdown
Contributor

Any issues with compat on older TF projects, no right?

Tested these series of PRs regarding inference on older TF projects and analyzed some videos.
No issues there.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants