-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
[Optimization] Use a cheaper cache key in get_model_architecture
#25682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a caching mechanism for the model configuration hash to optimize performance. While the caching logic itself is sound, the implementation for cache invalidation via __setattr__ introduces a critical flaw by allowing mutations on the ModelConfig object that can lead to an inconsistent state. This can cause silent misconfigurations and hard-to-debug issues. I've provided detailed comments on this and other potential improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces complexity, it would be better if we can just not recompute model arch or class.
get_model_architecture
This reverts commit 9fd2542.
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
|
Updated according to #25671 (comment), see if it looks good to you now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing!
…25682) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: yewentao256 <zhyanwentao@126.com>
…llm-project#25682) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
…llm-project#25682) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
…llm-project#25682) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
…llm-project#25682) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Purpose
FIX (partial) #25671
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.