-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dataclass args for accelerated MoE tuning (#390)
* feat: accelerated MoE dataclass and init Signed-off-by: Will Johnson <[email protected]> * fix: author's note Signed-off-by: Will Johnson <[email protected]> * feat: accelerated moe in acceleration framework Signed-off-by: Will Johnson <[email protected]> * feat: accelerated moe to sft_trainer Signed-off-by: Will Johnson <[email protected]> * feat: fmt, testing Signed-off-by: Will Johnson <[email protected]> * fix: rename accelerated moe to fast moe Signed-off-by: Will Johnson <[email protected]> * test: add testing for scatter moe on accel framework Signed-off-by: Will Johnson <[email protected]> * fix: model, dtype, assertions Signed-off-by: Will Johnson <[email protected]> * fix: post init check removed from FastMoe, experimental set to True Signed-off-by: Will Johnson <[email protected]> * fix: if non-iterable nested dataclass, still initialize Signed-off-by: Will Johnson <[email protected]> * test: add failing test for wrong ep_degree Signed-off-by: Will Johnson <[email protected]> * fix: actually expect failure Signed-off-by: Will Johnson <[email protected]> * test: make sure fast moe doesn't work with non-moe model Signed-off-by: Will Johnson <[email protected]> * fix: regex of new test Signed-off-by: Will Johnson <[email protected]> * comment: explain iterable unpacking Signed-off-by: Will Johnson <[email protected]> * docs: fast MOE in README Signed-off-by: Will Johnson <[email protected]> * docs: Add note for post-processing Signed-off-by: Will Johnson <[email protected]> * fix: Dockerfile Signed-off-by: Will Johnson <[email protected]> * test: fix params Signed-off-by: Will Johnson <[email protected]> * fix: file path Signed-off-by: Will Johnson <[email protected]> * fix: expand on docs, remove from Dockerfile, move iterable data to else statement Signed-off-by: Will Johnson <[email protected]> * lint Signed-off-by: Will Johnson <[email protected]> * fix: spelling Signed-off-by: Will Johnson <[email protected]> --------- Signed-off-by: Will Johnson <[email protected]>
- Loading branch information
Showing
10 changed files
with
270 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
14 changes: 14 additions & 0 deletions
14
tuning/config/acceleration_configs/attention_and_distributed_packing.py
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright The FMS HF Tuning Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Standard | ||
from dataclasses import dataclass | ||
|
||
# Local | ||
from .utils import ensure_nested_dataclasses_initialized, parsable_dataclass | ||
|
||
|
||
@parsable_dataclass | ||
@dataclass | ||
class FastMoe: | ||
|
||
ep_degree: int = 1 | ||
|
||
|
||
@dataclass | ||
class FastMoeConfig: | ||
|
||
fast_moe: FastMoe = None | ||
|
||
def __post_init__(self): | ||
# ensure nested dataclasses initialized | ||
ensure_nested_dataclasses_initialized(self) |
Oops, something went wrong.