Fix long import times due to processing all pydantic subclasses#689
Open
jaredoconnell wants to merge 3 commits intovllm-project:mainfrom
Open
Fix long import times due to processing all pydantic subclasses#689jaredoconnell wants to merge 3 commits intovllm-project:mainfrom
jaredoconnell wants to merge 3 commits intovllm-project:mainfrom
Conversation
Other libraries that use pydantic could end up being processed by GuideLLM, significantly increasing the number of classes processed, noticeably increasing import times for GuideLLM. Assisted-by: Cursor AI Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
dbutenhof
approved these changes
Apr 10, 2026
Collaborator
dbutenhof
left a comment
There was a problem hiding this comment.
Excellent! But, as Webb might say, just a few nits ...
| def reload_parent_schemas(cls): | ||
| """ | ||
| Recursively reload schemas for all parent Pydantic models. | ||
| Recursively reload schemas for all Pydantic models that reference this |
Collaborator
There was a problem hiding this comment.
"for all GuideLLM Pydantic models ..." ?? Yeah, "that reference this" covers that base, but it's a bit less direct.
Collaborator
Author
There was a problem hiding this comment.
What type of change would you suggest?
Collaborator
|
Ha -- you might consider modifying the PR title: it's an incomplete sentence, and it displays as "Fix long import times due to #689", which just looks odd! |
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.
Summary
Other libraries that use pydantic could end up being processed by GuideLLM, significantly increasing the number of classes processed, noticeably increasing import times for GuideLLM.
Also, in my testing, it makes it so the startup times are less than half of what they were before.
Details
BenchmarkConfig,BenchmarkGenerativeTextArgs, andProfile,Test Plan
Related Issues
import guidellmcan take a very long time in some environments #688Use of AI
## WRITTEN BY AI ##)