-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Mistral-7B-Instruct-v0.1 from huggingface. (#2010)
Summary: Add Mistral-7B-Instruct-v0.1 from huggingface. See https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1 Pull Request resolved: #2010 Reviewed By: aaronenyeshi Differential Revision: D50692789 Pulled By: xuzhao9 fbshipit-source-id: 7aa3c455882726ac3b1a50c2ca349eee9c34c938
- Loading branch information
1 parent
11376ae
commit 97d6b17
Showing
6 changed files
with
47 additions
and
4 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
19 changes: 19 additions & 0 deletions
19
torchbenchmark/canary_models/mistral_7b_instruct/__init__.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from torchbenchmark.tasks import NLP | ||
from torchbenchmark.util.framework.huggingface.model_factory import HuggingFaceModel | ||
|
||
class Model(HuggingFaceModel): | ||
task = NLP.LANGUAGE_MODELING | ||
# DEFAULT_TRAIN_BSIZE not specified since we're not implementing a train test | ||
# DEFAULT_TRAIN_BSIZE = 1 | ||
DEFAULT_EVAL_BSIZE = 1 | ||
|
||
def __init__(self, test, device, batch_size=None, extra_args=[]): | ||
super().__init__(name="mistral_7b_instruct", test=test, device=device, batch_size=batch_size, extra_args=extra_args) | ||
|
||
def train(self): | ||
return NotImplementedError("Not implemented") | ||
|
||
def eval(self): | ||
if (self.device == "cpu"): | ||
raise NotImplementedError("mistral_7b_instruct model is too slow on CPU - skip CPU test.") | ||
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,9 @@ | ||
import subprocess | ||
import sys | ||
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) |
11 changes: 11 additions & 0 deletions
11
torchbenchmark/canary_models/mistral_7b_instruct/metadata.yaml
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,11 @@ | ||
devices: | ||
- device: NVIDIA A10G | ||
- device: NVIDIA A100-SXM4-40GB | ||
eval_batch_size: 1 | ||
eval_benchmark: false | ||
eval_deterministic: false | ||
eval_nograd: true | ||
train_benchmark: false | ||
train_deterministic: false | ||
not_implemented: | ||
- device: cpu |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
einops | ||
einops | ||
flash_attn |
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