-
Notifications
You must be signed in to change notification settings - Fork 99
[Fix] Fix the optimization for TagDispatch and SubGrammarAdder. #471
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
[Fix] Fix the optimization for TagDispatch and SubGrammarAdder. #471
Conversation
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.
Pull Request Overview
This PR fixes a concurrency issue in the TagDispatch optimization by converting a class member variable to a local variable that is passed by reference to the optimization function. This eliminates potential race conditions when multiple threads access the optimization data structure.
Key Changes:
- Moved the
tag_dispatch_rule_id_to_second_slicing_bitsetfrom a class member to a local variable - Extracted the TagDispatch optimization logic into a separate method that accepts the map by pointer parameter
- Added documentation for the new
TagDispatchOptimizationmethod
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a86d04d to
674f2f4
Compare
Ubospica
left a comment
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.
Please see if you can reproduce it, even though the running time of the test is large. We can consider putting heavy tests in a daily efficiency test.
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.
Please see if you can reproduce it, even though the running time of the test is large. We can consider putting heavy tests in a daily efficiency test. It's fine if it's too difficult or complex to do so.
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
6d53e3a to
7c2cfd7
Compare
This PR fixes a concurrency problem in the optimization for TagDispatch, and fixes a bug in
SubGrammarAdder.