Skip to content
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

Add LLaMA2 model to pt nightly tests #965

Merged
merged 26 commits into from
Aug 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c777f8e
Add LLaMA2 model to pt nightly tests
ManfeiBai Aug 2, 2023
8a6fb51
Update targets.jsonnet adding LLaMA2
ManfeiBai Aug 2, 2023
164eb1a
Update llama2-model.libsonnet with data
ManfeiBai Aug 4, 2023
fb616f6
Update llama2-model.libsonnet format
ManfeiBai Aug 4, 2023
bd8b059
Update targets.jsonnet
ManfeiBai Aug 4, 2023
1ff2c21
Update llama2-model.libsonnet
ManfeiBai Aug 4, 2023
5d78abc
Update llama2-model.libsonnet
ManfeiBai Aug 4, 2023
433da86
Update llama2-model.libsonnet
ManfeiBai Aug 4, 2023
4bc01a3
Update llama2-model.libsonnet
ManfeiBai Aug 4, 2023
8e0ac8d
Update llama2-model.libsonnet
ManfeiBai Aug 16, 2023
a726647
Update llama2-model.libsonnet
ManfeiBai Aug 16, 2023
98cc9bb
Update llama2-model.libsonnet
ManfeiBai Aug 16, 2023
4a8c9f6
Update llama2-model.libsonnet
ManfeiBai Aug 16, 2023
01f5484
Update llama2-model.libsonnet
ManfeiBai Aug 17, 2023
315f2e7
Update llama2-model.libsonnet
ManfeiBai Aug 17, 2023
761fd1c
Update llama2-model.libsonnet
ManfeiBai Aug 18, 2023
13bc21c
Update llama2-model.libsonnet
ManfeiBai Aug 18, 2023
c2a6695
Update llama2-model.libsonnet
ManfeiBai Aug 18, 2023
64d2765
Update llama2-model.libsonnet
ManfeiBai Aug 21, 2023
335c2d2
Update llama2-model.libsonnet
ManfeiBai Aug 22, 2023
252143b
Update llama2-model.libsonnet
ManfeiBai Aug 22, 2023
99a6b0a
Update llama2-model.libsonnet
ManfeiBai Aug 22, 2023
87d508b
add `latency/token` as a threshold for llama2 test
ManfeiBai Aug 23, 2023
6923691
Update llama2-model.libsonnet with `latency/token` threshold
ManfeiBai Aug 24, 2023
8de98b7
Update llama2-model.libsonnet
ManfeiBai Aug 24, 2023
18f87a1
Update llama2-model.libsonnet with training
ManfeiBai Aug 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add LLaMA2 model to pt nightly tests
ManfeiBai authored Aug 2, 2023
commit c777f8eafc94ec8a64e26aff47ca9d389497b8c8
126 changes: 126 additions & 0 deletions tests/pytorch/nightly/llama2-model.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// 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
//
// https://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.

local experimental = import '../experimental.libsonnet';
local common = import 'common.libsonnet';
local timeouts = import 'templates/timeouts.libsonnet';
local tpus = import 'templates/tpus.libsonnet';
local utils = import 'templates/utils.libsonnet';

{
local llama2-google-next-inference-pretrained-models = self.llama2-google-next-inference-pretrained-models,
llama2-google-next-inference-pretrained-models:: common.PyTorchTest {
local config = self,
modelName: 'llama2-model',
paramsOverride:: {
scriptPath: 'example_text_completion.py',
trainCommand: [
'torchrun --nproc_per_node 1',
self.scriptPath,
'--ckpt_dir llama-2-7b/',
'--tokenizer_path tokenizer.model',
'--max_seq_len 128 --max_batch_size 4',
],
},
command: self.paramsOverride.trainCommand,
},
local llama2-google-next-inference-fine-tuned-chat-models = self.llama2-google-next-inference-fine-tuned-chat-models,
llama2-google-next-inference-fine-tuned-chat-models:: common.PyTorchTest {
local config = self,
modelName: 'llama2-model',
paramsOverride:: {
scriptPath: 'example_chat_completion.py',
trainCommand: [
'torchrun --nproc_per_node 1',
self.scriptPath,
'--ckpt_dir llama-2-7b-chat/',
'--tokenizer_path tokenizer.model',
'--max_seq_len 512 --max_batch_size 4',
],
},
command: self.paramsOverride.trainCommand,
},
local llama2-stable-tokenizer = self.llama2-stable-tokenizer,
llama2-stable-tokenizer:: common.PyTorchTest {
local config = self,
modelName: 'llama2-model',
paramsOverride:: {
scriptPath: 'example.py',
trainCommand: [
'torchrun --nproc_per_node MP',
self.scriptPath,
'--ckpt_dir $TARGET_FOLDER/model_size',
'--tokenizer_path $TARGET_FOLDER/tokenizer.model',
],
},
command: self.paramsOverride.trainCommand,
},
local llama2-stable-quant = self.llama2-stable-quant,
llama2-stable-quant:: common.PyTorchTest {
local config = self,
modelName: 'llama2-model',
paramsOverride:: {
scriptPath: 'example_xla.py',
trainCommand: [
'python3',
self.scriptPath,
'--tokenizer_path $TOKENIZER_PATH',
'--max_seq_len 256',
'--max_batch_size 1',
'--temperature 0.8',
'--dim 4096',
'--n_heads 32',
'--n_layers 32',
'--mp True',
],
},
command: self.paramsOverride.trainCommand,
},
local llama2-google-next-inference = self.llama2-google-next-inference,
llama2-google-next-inference:: common.PyTorchTpuVmMixin {
modelName+: '-llama2-google-next-inference',
tpuSettings+: {
tpuVmExtraSetup: |||
git clone -b llama2-google-next-inference https://github.com/pytorch-tpu/llama.git
cd llama
pip install -r requirements.txt
pip install -e .
|||,
},
},
local stable = self.stable,
stable:: common.PyTorchTpuVmMixin {
modelName+: '-stable',
tpuSettings+: {
tpuVmExtraSetup: |||
git clone -b stable https://github.com/pytorch-tpu/llama.git
cd llama
pip install -r requirements.txt
pip install -e .
|||,
},
},

local v4_8 = self.v4_8,
v4_8:: {
accelerator: tpus.v4_8,
},

configs: [
// llama2-google-next-inference-pretrained-models + v4_8 + common.Functional + timeouts.Hours(3) + google-next-inference,
// llama2-google-next-inference-fine-tuned-chat-models + v4_8 + common.Functional + timeouts.Hours(3) + google-next-inference,
// llama2-stable-tokenizer + v4_8 + common.Functional + timeouts.Hours(3) + stable,
// llama2-stable-quant + v4_8 + common.Functional + timeouts.Hours(3) + stable,
],
}