-
Notifications
You must be signed in to change notification settings - Fork 249
[MoE Calibration] Simplify MoE calibration interface #1851
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
Open
sairampillai
wants to merge
18
commits into
vllm-project:main
Choose a base branch
from
sairampillai:moe_calibration_refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0994db6
Deprecate replace_modules_for_calibration
sairampillai c7a9943
Refactor MoECalibrationContext
sairampillai e374313
Use moe_context in pipeline and by default and add tests
sairampillai 7fefaac
Update documentation
sairampillai 858a0f6
Deprecate replace_modules_for_calibration
sairampillai ef8e0b7
Refactor MoECalibrationContext
sairampillai b04f957
Use moe_context in pipeline and by default and add tests
sairampillai ba42881
Update documentation
sairampillai 6a38a0f
Update docstrings to fix review comments
sairampillai 61c5141
Merge branch 'moe_calibration_refactor' of https://github.com/sairamp…
sairampillai 9a131cb
Fix style and quality checks
sairampillai 4520421
Deprecate replace_modules_for_calibration
sairampillai 1c15741
Refactor MoECalibrationContext
sairampillai d8fecb9
Use moe_context in pipeline and by default and add tests
sairampillai d099bf3
Update documentation
sairampillai 1bb9f62
Merge branch 'moe_calibration_refactor' of https://github.com/sairamp…
sairampillai d4a6a11
Fix style and quality checks
sairampillai b19e3b6
Merge branch 'moe_calibration_refactor' of https://github.com/sairamp…
sairampillai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
HuggingFace datasets, custom JSON/CSV files, and DVC-managed datasets. | ||
""" | ||
|
||
import warnings | ||
from dataclasses import dataclass, field | ||
from typing import Any, Callable, Dict, List, Optional, Union | ||
|
||
|
@@ -126,16 +127,6 @@ class DatasetArguments(CustomDatasetArguments): | |
default=512, | ||
metadata={"help": "Number of samples to use for one-shot calibration"}, | ||
) | ||
calibrate_moe_context: bool = field( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a dataset argument called |
||
default=False, | ||
metadata={ | ||
"help": "If during calibration, the MoE context should be enabled " | ||
"for the given model. This usually involves updating all MoE modules " | ||
"in the model for the duration of calibration. See moe_context under " | ||
"modeling/prepare.py for a list of supported MoEs and their updated " | ||
"module definitions" | ||
}, | ||
) | ||
shuffle_calibration_samples: Optional[bool] = field( | ||
default=True, | ||
metadata={ | ||
|
@@ -181,6 +172,17 @@ class DatasetArguments(CustomDatasetArguments): | |
), | ||
}, | ||
) | ||
calibrate_moe_context: Optional[bool] = field( | ||
default=None, | ||
metadata={ | ||
"help": ( | ||
"DEPRECATED: This parameter is deprecated and will be \ | ||
removed in a future version. " | ||
"MoE calibration context is now handled automatically by the pipeline. " | ||
"This parameter is ignored and will not affect the calibration process." | ||
), | ||
}, | ||
) | ||
# --- pipeline arguments --- # | ||
pipeline: Optional[str] = field( | ||
default="independent", | ||
|
@@ -229,3 +231,16 @@ class DatasetArguments(CustomDatasetArguments): | |
|
||
def is_dataset_provided(self) -> bool: | ||
return self.dataset is not None or self.dataset_path is not None | ||
|
||
def __post_init__(self): | ||
"""Post-initialization hook to issue deprecation warnings.""" | ||
if self.calibrate_moe_context is not None: | ||
warnings.warn( | ||
"The 'calibrate_moe_context' parameter is deprecated\ | ||
and will be removed in a future version. " | ||
"MoE calibration context is now handled automatically by the pipeline. " | ||
"This parameter is ignored and will not affect\ | ||
the calibration process.", | ||
DeprecationWarning, | ||
stacklevel=2, | ||
) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.