fix: Do not autofill default_model_filename for Python-runtime PyTorch models - #518
Merged
Merged
Conversation
Greptile SummaryThe PR narrows PyTorch model filename autofill and adds regression coverage.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (5): Last reviewed commit: "fix pre-commit" | Re-trigger Greptile |
20 tasks
yinggeh
reviewed
Aug 3, 2026
yinggeh
reviewed
Aug 7, 2026
| // and a weights "model.pt" in the version directory must not have "model.pt" | ||
| // autofilled as the default model filename, otherwise the runtime attempts | ||
| // torch.jit.load() on the weights file. | ||
| TEST_F(AutoCompleteBackendFieldsTest, PythonRuntimeLibTorchKeepsFilenameEmpty) |
Contributor
There was a problem hiding this comment.
Is it possible to merge test cases into a for loop?
yinggeh
approved these changes
Aug 12, 2026
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the PR do?
Since #484,
AutoCompleteBackendFieldsautofillsdefault_model_filename: "model.pt"for everybackend: "pytorch"model with an empty platform — including models using the Python-based runtime (runtime: "model.py"). For those models a siblingmodel.ptis the weights companion to themodel.pyclass, and the runtime givesdefault_model_filenametop priority, so it callstorch.jit.load()on the weights file and fails at load withPytorchStreamReader failed locating file constants.pkl.Restores the pre-#484 guard — skip filename autofill when
runtimeis"model.py"— and extends it to the AOTI platform branch (model.pt2), which the Python runtime cannot load either. Output is unchanged for every other config. #484's stated goal (correct .pt2 selection for torch_aoti) is preserved and now pinned by tests.Adds
AutoCompleteBackendFieldsTesttorepo_agent_test(which already compilesmodel_config_utils.cc): the two Python-runtime regression cases plus six cases pinning existing autofill and version-dir sniffing behavior. The regression cases fail without the fix and pass with it.Checklist
<commit_type>: <Title>Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
triton-inference-server/server#8913
Where should the reviewer start?
Test plan:
Test case added here
60326198
Caveats:
Background
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)