Skip to content

Commit

Permalink
disable overlap for qkv (#9072)
Browse files Browse the repository at this point in the history
* disable overlap for qkv

Signed-off-by: Rachit Garg <rachitg@login-eos01.eos.clusters.nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Rachit Garg <rachitg@login-eos01.eos.clusters.nvidia.com>
Co-authored-by: Rachit Garg <rachitg@login-eos01.eos.clusters.nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored May 1, 2024
1 parent be46b63 commit 5ecc903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def mcore_register_adapters(self):
if (
self.config.sequence_parallel
and hasattr(self.linear_qkv, "return_layernorm_output_gathered")
and not self.config.tp_comm_overlap
and not self.linear_qkv.ub_overlap_ag
):
# for LoRA SP, TE v1.5 can return layernorm output gathered so there is no need
# to perform the redundant gather in the adapter module, unless TP communication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def __init__(
from pkg_resources import packaging

te_version = packaging.version.Version(version("transformer-engine"))
if te_version >= packaging.version.Version("1.5.0dev") and not model_parallel_config.tp_comm_overlap:
if te_version >= packaging.version.Version("1.5.0dev") and (
not self.input_is_parallel and not model_parallel_config.tp_comm_atomic_ag
):
# TE 1.5 introduces the option `return_layernorm_output_gathered`, so the all gather
# in the forward method is not needed, so set self._sequence_parallel to False
# unless TP communication overlap is used
Expand Down

0 comments on commit 5ecc903

Please sign in to comment.