Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
galore-replication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Riko Corwin Uphoff
galore-replication
Commits
140033be
Commit
140033be
authored
1 week ago
by
Riko Corwin Uphoff
Browse files
Options
Downloads
Patches
Plain Diff
Fixed number of training steps for real; Adjusted default parameters;
parent
c36e7631
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#25297
passed
1 week ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
args.py
+1
-1
1 addition, 1 deletion
args.py
main.py
+3
-1
3 additions, 1 deletion
main.py
scripts/shell/pretrain_60m.sh
+18
-0
18 additions, 0 deletions
scripts/shell/pretrain_60m.sh
scripts/shell/pretrain_7b.sh
+18
-0
18 additions, 0 deletions
scripts/shell/pretrain_7b.sh
with
40 additions
and
2 deletions
args.py
+
1
−
1
View file @
140033be
...
...
@@ -6,7 +6,7 @@ parser.add_argument("--optimizer", type=str, choices=["lora", "galore", "galore8
parser
.
add_argument
(
"
--lr_scheduler
"
,
type
=
str
,
choices
=
[
"
constant
"
,
"
linear
"
,
"
cosine
"
],
default
=
"
constant
"
)
parser
.
add_argument
(
"
--model
"
,
type
=
str
,
choices
=
[
"
llama_60m
"
,
"
llama_1b
"
,
"
llama_7b
"
,
"
roberta
"
,
"
gpt2
"
],
required
=
True
,
help
=
"
Model to use
"
)
parser
.
add_argument
(
"
--batch_size
"
,
type
=
int
,
default
=
16
,
help
=
"
Batch size
"
)
parser
.
add_argument
(
"
--num_epochs
"
,
type
=
int
,
default
=
30
,
help
=
"
Number of epochs
"
)
parser
.
add_argument
(
"
--num_epochs
"
,
type
=
int
,
default
=
1
,
help
=
"
Number of epochs
"
)
parser
.
add_argument
(
"
--max_length
"
,
type
=
int
,
default
=
512
,
help
=
"
Max length of input tokens
"
)
parser
.
add_argument
(
"
--num_training_tokens
"
,
type
=
int
,
default
=
1e9
,
help
=
"
Number of training tokens
"
)
parser
.
add_argument
(
"
--shuffle
"
,
type
=
str
,
choices
=
[
"
true
"
,
"
false
"
],
default
=
"
false
"
,
help
=
"
Shuffle data (doesn
'
t work in streaming mode)
"
)
...
...
This diff is collapsed.
Click to expand it.
main.py
+
3
−
1
View file @
140033be
...
...
@@ -66,6 +66,7 @@ if __name__ == "__main__":
print
(
f
"
Running on:
{
device
}
"
)
print
(
f
"
Using optimizer:
{
args
.
optimizer
}
"
)
print
(
f
"
Arguments:
{
args
}
"
)
init_csv
()
model
,
tokenizer
=
get_model
(
args
)
...
...
@@ -82,7 +83,8 @@ if __name__ == "__main__":
optimizer
,
model
=
get_optimizer
(
args
,
model
)
num_steps
=
ceil
(
args
.
num_epochs
*
len
(
dataloader
))
num_batches
=
len
(
dataloader
)
if
args
.
mode
==
"
finetuning
"
else
ceil
(
args
.
num_training_tokens
/
args
.
batch_size
)
num_steps
=
args
.
num_epochs
*
num_batches
scheduler
=
get_scheduler
(
optimizer
,
args
.
lr_scheduler
,
args
.
warm_up_fraction
,
num_steps
,
args
.
lr
,
args
.
lr_min
)
...
...
This diff is collapsed.
Click to expand it.
scripts/shell/pretrain_60m.sh
0 → 100755
+
18
−
0
View file @
140033be
#!/bin/bash
python3 main.py
\
--mode
pretraining
\
--optimizer
galore
\
--model
llama_60m
\
--batch_size
8
\
--num_epochs
1
\
--num_training_tokens
10000
\
--max_length
256
\
--shuffle
false
\
--dtype
bf16
\
--lr_scheduler
cosine
\
--lr
1e-4
\
--lr_min
1e-5
\
--warm_up_fraction
0.1
\
--weight_decay
0
\
--test
false
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/shell/pretrain_7b.sh
0 → 100644
+
18
−
0
View file @
140033be
#!/bin/bash
python3 main.py
\
--mode
pretraining
\
--optimizer
galore8bit
\
--model
llama_7b
\
--batch_size
131000
\
--num_epochs
1
\
--num_training_tokens
13100000
\
--max_length
256
\
--shuffle
false
\
--dtype
bf16
\
--lr_scheduler
cosine
\
--lr
1e-4
\
--lr_min
1e-5
\
--warm_up_fraction
0.1
\
--weight_decay
0
\
--test
false
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment