Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
44ca61a2
Unverified
Commit
44ca61a2
authored
Feb 05, 2024
by
Camille Zhong
Committed by
GitHub
Feb 05, 2024
Browse files
[llama] fix neftune & pbar with start_step (#5364)
parent
a4cec171
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
applications/Colossal-LLaMA-2/colossal_llama2/utils/neftune_patch.py
...s/Colossal-LLaMA-2/colossal_llama2/utils/neftune_patch.py
+1
-1
applications/Colossal-LLaMA-2/train.py
applications/Colossal-LLaMA-2/train.py
+2
-2
No files found.
applications/Colossal-LLaMA-2/colossal_llama2/utils/neftune_patch.py
View file @
44ca61a2
...
@@ -17,7 +17,7 @@ import torch
...
@@ -17,7 +17,7 @@ import torch
def
unwrap
(
model
):
def
unwrap
(
model
):
if
hasattr
(
model
,
"module"
):
if
hasattr
(
model
,
"module"
):
return
unwrap_model
(
model
.
module
)
return
model
.
unwrap
(
)
else
:
else
:
return
model
return
model
...
...
applications/Colossal-LLaMA-2/train.py
View file @
44ca61a2
...
@@ -329,9 +329,9 @@ def main() -> None:
...
@@ -329,9 +329,9 @@ def main() -> None:
for
epoch
in
range
(
start_epoch
,
args
.
num_epochs
):
for
epoch
in
range
(
start_epoch
,
args
.
num_epochs
):
dataloader
.
sampler
.
set_epoch
(
epoch
=
epoch
)
dataloader
.
sampler
.
set_epoch
(
epoch
=
epoch
)
pbar
=
tqdm
(
desc
=
f
"Epoch
{
epoch
}
"
,
disable
=
not
coordinator
.
is_master
(),
total
=
num_steps_per_epoch
)
pbar
=
tqdm
(
desc
=
f
"Epoch
{
epoch
}
"
,
disable
=
not
coordinator
.
is_master
(),
total
=
num_steps_per_epoch
,
initial
=
start_step
//
args
.
accumulation_steps
)
total_loss
=
torch
.
tensor
(
0.0
,
device
=
get_current_device
())
total_loss
=
torch
.
tensor
(
0.0
,
device
=
get_current_device
())
for
step
,
batch
in
enumerate
(
dataloader
):
for
step
,
batch
in
enumerate
(
dataloader
,
start
=
start_step
):
batch
=
{
k
:
v
.
to
(
get_current_device
())
for
k
,
v
in
batch
.
items
()
if
isinstance
(
v
,
torch
.
Tensor
)}
batch
=
{
k
:
v
.
to
(
get_current_device
())
for
k
,
v
in
batch
.
items
()
if
isinstance
(
v
,
torch
.
Tensor
)}
batch_output
=
model
(
**
batch
)
batch_output
=
model
(
**
batch
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment