Commit 0dd5cc75 authored by mshoeybi's avatar mshoeybi
Browse files

tested and working

parent ee536123
# 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)
...@@ -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():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment