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
fef5c949
Unverified
Commit
fef5c949
authored
Jan 13, 2023
by
Ziyue Jiang
Committed by
GitHub
Jan 13, 2023
Browse files
polish pp middleware (#2476)
Co-authored-by:
Ziyue Jiang
<
ziyue.jiang@gmail.com
>
parent
a5dc4253
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
colossalai/pipeline/rpc/_pipeline_base.py
colossalai/pipeline/rpc/_pipeline_base.py
+2
-2
colossalai/pipeline/rpc/_pipeline_schedule.py
colossalai/pipeline/rpc/_pipeline_schedule.py
+0
-3
examples/language/gpt/experiments/pipeline_parallel/train_gpt_pp.py
...anguage/gpt/experiments/pipeline_parallel/train_gpt_pp.py
+1
-1
No files found.
colossalai/pipeline/rpc/_pipeline_base.py
View file @
fef5c949
...
...
@@ -211,7 +211,7 @@ class WorkerBase(ABC):
refcount
=
0
with
self
.
output_list_condition_lock
:
if
refcount
<
lifecycle
:
if
refcount
<
=
lifecycle
:
self
.
output_list
[
key
]
=
output_work_item
self
.
output_list_condition_lock
.
notify_all
()
...
...
@@ -390,7 +390,7 @@ class WorkerBase(ABC):
subscribe_forward_futures
[
target_index
]
=
[]
else
:
subscribe_forward_futures
[
target_index
]
=
producer_worker_rref
.
rpc_async
().
get_output_by_key
(
producer_output_key
,
rank
=
self
.
pp_rank
)
producer_output_key
,
rank
=
self
.
pp_rank
,
offsets
=
offsets
)
else
:
for
i
in
range
(
producer_num
):
...
...
colossalai/pipeline/rpc/_pipeline_schedule.py
View file @
fef5c949
...
...
@@ -29,9 +29,6 @@ class FillDrainWorker(WorkerBase):
target_key
=
UniqueKey
(
target_microbatch_id
,
target_phase
)
with
self
.
work_list_condition_lock
:
self
.
work_list_condition_lock
.
wait_for
(
lambda
:
target_key
in
self
.
work_list
)
return
target_key
...
...
examples/language/gpt/experiments/pipeline_parallel/train_gpt_pp.py
View file @
fef5c949
...
...
@@ -120,7 +120,7 @@ def run_master(args):
logger
.
info
(
f
'
{
rank
=
}
numel in the partition:
{
numel
}
'
)
# build optim
pp_engine
.
initialize_optimizer
(
Hybrid
Adam
,
lr
=
1e-3
)
pp_engine
.
initialize_optimizer
(
torch
.
optim
.
Adam
,
lr
=
1e-3
)
ranks_tflops
=
{}
for
n
in
range
(
NUM_STEPS
):
...
...
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