-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[Bugfix][1/n] Fix the speculative decoding test by setting the target dtype #19633
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,9 @@ | |||||||
|
|
||||||||
| # Skip cuda graph recording for fast test. | ||||||||
| "enforce_eager": True, | ||||||||
|
|
||||||||
| # The original model is float32, keep it for numerical stability. | ||||||||
| "dtype": "float32", | ||||||||
| }]) | ||||||||
| @pytest.mark.parametrize( | ||||||||
| "per_test_common_llm_kwargs", | ||||||||
|
|
@@ -139,6 +142,9 @@ def test_spec_decode_e2e_with_detokenization(test_llm_generator, | |||||||
|
|
||||||||
| # Print spec metrics. | ||||||||
| "disable_log_stats": False, | ||||||||
|
|
||||||||
| # The original model is float32, keep it for numerical stability. | ||||||||
| "dtype": "float32", | ||||||||
|
||||||||
| # The original model is float32, keep it for numerical stability. | |
| "dtype": "float32", | |
| **_COMMON_FLOAT32_KWARGS, |
Outdated
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 is another instance of the repeated dtype configuration. Using a shared dictionary (e.g., **_COMMON_FLOAT32_KWARGS) would be beneficial for maintainability here as well.
| # The original model is float32, keep it for numerical stability. | |
| "dtype": "float32", | |
| **_COMMON_FLOAT32_KWARGS, |
Outdated
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.
The dtype configuration is repeated here. Consider using the suggested shared dictionary pattern (e.g., **_COMMON_FLOAT32_KWARGS) to centralize this setting for better maintainability.
| # The original model is float32, keep it for numerical stability. | |
| "dtype": "float32", | |
| **_COMMON_FLOAT32_KWARGS, |
Outdated
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.
Outdated
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.
Outdated
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.
Outdated
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.
Outdated
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 is the final instance of the repeated dtype configuration in this PR. Using a shared dictionary (e.g., **_COMMON_FLOAT32_KWARGS) would be beneficial for maintainability.
| # The original model is float32, keep it for numerical stability. | |
| "dtype": "float32", | |
| **_COMMON_FLOAT32_KWARGS, |
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
dtypesetting and its accompanying comment are repeated in several places throughout this file. To enhance maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider defining these common keyword arguments in a shared dictionary at the module level. This dictionary can then be spread into each specificcommon_llm_kwargsdictionary where this setting is needed.For instance, you could define a constant like this at the module scope:
And then utilize it within the
parametrizedecorator as shown in the suggestion below. This approach centralizes the configuration, making future updates simpler and more consistent.