-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MPT-7B-instruct HuggingFace Model (#1773)
Summary: PR to add https://huggingface.co/mosaicml/mpt-7b-instruct in torchbenchmark. Running mpt-7b-instruct requires ```trust_remote_code``` to be passed Pull Request resolved: #1773 Reviewed By: msaroufim Differential Revision: D48031826 Pulled By: xuzhao9 fbshipit-source-id: d3cada22894544a88409ef11ccd4b0b101507a2a
- Loading branch information
1 parent
e7ca300
commit 0b7147f
Showing
5 changed files
with
36 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from torchbenchmark.tasks import NLP | ||
from torchbenchmark.util.framework.huggingface.model_factory import HuggingFaceModel | ||
|
||
class Model(HuggingFaceModel): | ||
task = NLP.LANGUAGE_MODELING | ||
# https://huggingface.co/mosaicml/mpt-7b | ||
DEFAULT_TRAIN_BSIZE = 4 | ||
DEFAULT_EVAL_BSIZE = 1 | ||
|
||
def __init__(self, test, device, batch_size=None, extra_args=[]): | ||
super().__init__(name="hf_MPT_7b_instruct", test=test, device=device, batch_size=batch_size, extra_args=extra_args) | ||
|
||
def eval(self): | ||
super().eval() |
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,7 @@ | ||
import os | ||
from torchbenchmark.util.framework.huggingface.patch_hf import patch_transformers, cache_model | ||
|
||
if __name__ == '__main__': | ||
patch_transformers() | ||
model_name = os.path.basename(os.path.dirname(os.path.abspath(__file__))) | ||
cache_model(model_name, trust_remote_code=True) |
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,8 @@ | ||
devices: | ||
NVIDIA A100-SXM4-40GB: | ||
eval_batch_size: 1 | ||
eval_benchmark: false | ||
eval_deterministic: false | ||
eval_nograd: true | ||
train_benchmark: false | ||
train_deterministic: false |
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