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
wuxk1
Megatron-LM
Commits
0dd5cc75
Commit
0dd5cc75
authored
Oct 13, 2021
by
mshoeybi
Browse files
tested and working
parent
ee536123
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
megatron/text_generation/__init__.py
megatron/text_generation/__init__.py
+19
-0
megatron/text_generation/communication.py
megatron/text_generation/communication.py
+2
-0
No files found.
megatron/text_generation/__init__.py
0 → 100644
View file @
0dd5cc75
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# 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
#
# http://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.
from
.api
import
(
generate
,
generate_and_post_process
)
megatron/text_generation/communication.py
View file @
0dd5cc75
...
@@ -22,6 +22,7 @@ from megatron import mpu
...
@@ -22,6 +22,7 @@ from megatron import mpu
# TODO: use functions from megatron/p2p
def
recv_from_prev_pipeline_rank_
(
recv_buffer
=
None
):
def
recv_from_prev_pipeline_rank_
(
recv_buffer
=
None
):
"""Receive from previous pipeline stage and update the
"""Receive from previous pipeline stage and update the
input buffer inplace."""
input buffer inplace."""
...
@@ -38,6 +39,7 @@ def recv_from_prev_pipeline_rank_(recv_buffer=None):
...
@@ -38,6 +39,7 @@ def recv_from_prev_pipeline_rank_(recv_buffer=None):
# TODO: use functions from megatron/p2p
def
send_to_next_pipeline_rank
(
tensor
=
None
):
def
send_to_next_pipeline_rank
(
tensor
=
None
):
"""Send output to the next pipeline stage."""
"""Send output to the next pipeline stage."""
if
not
mpu
.
is_pipeline_last_stage
():
if
not
mpu
.
is_pipeline_last_stage
():
...
...
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