Skip to content

Commit

Permalink
Added codellama (testing, in canary).
Browse files Browse the repository at this point in the history
  • Loading branch information
MaanavD committed Jan 30, 2024
1 parent 8ecdf1a commit e190dda
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions torchbenchmark/canary_models/codellama/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from torchbenchmark.tasks import NLP
from torchbenchmark.util.framework.huggingface.model_factory import HuggingFaceModel, HuggingFaceAuthMixin

class Model(HuggingFaceModel, HuggingFaceAuthMixin):
task = NLP.LANGUAGE_MODELING
DEFAULT_TRAIN_BSIZE = 1
DEFAULT_EVAL_BSIZE = 1
DEEPCOPY = False

def __init__(self, test, device, batch_size=None, extra_args=[]):
HuggingFaceAuthMixin.__init__(self)
super().__init__(name="codellama", test=test, device=device, batch_size=batch_size, extra_args=extra_args)


# def train(self):
# return NotImplementedError("FSDP should implement a training loop")
9 changes: 9 additions & 0 deletions torchbenchmark/canary_models/codellama/install.py
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__':
model_name = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
cache_model(model_name)
12 changes: 12 additions & 0 deletions torchbenchmark/canary_models/codellama/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
devices:
NVIDIA A100-SXM4-40GB:
eval_batch_size: 1
eval_benchmark: false
eval_deterministic: false
eval_nograd: true
not_implemented:
- device: cpu
- device: cuda
test: train
train_benchmark: false
train_deterministic: false
1 change: 1 addition & 0 deletions torchbenchmark/util/framework/huggingface/model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'llama_v2_7b' : (512,512, 'AutoConfig.from_pretrained("meta-llama/Llama-2-7b-hf")', 'AutoModelForCausalLM'),
'llama_v2_13b' : (512,512, 'AutoConfig.from_pretrained("meta-llama/Llama-2-13b-hf")', 'AutoModelForCausalLM'),
'llama_v2_70b' : (512, 512, 'AutoConfig.from_pretrained("meta-llama/Llama-2-70b-hf")', 'AutoModelForMaskedLM'),
'codellama' : (512,512, 'AutoConfig.from_pretrained("codellama/CodeLlama-7b-hf")', 'AutoModelForCausalLM'),
'phi_1_5' : (512, 512, 'AutoConfig.from_pretrained("microsoft/phi-1_5", trust_remote_code=True)', 'AutoModelForCausalLM'),
'phi_2' : (512, 512, 'AutoConfig.from_pretrained("microsoft/phi-2", trust_remote_code=True)', 'AutoModelForCausalLM'),
# as per this page https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1 trust_remote_code=True is not required
Expand Down

0 comments on commit e190dda

Please sign in to comment.