-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [NCCL] reorg and better error messages (#3338)
Signed-off-by: Naren Dasan <[email protected]>
- Loading branch information
1 parent
095cec0
commit 45b28b7
Showing
11 changed files
with
1,575 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
py/torch_tensorrt/dynamo/conversion/custom_ops_converters.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# mypy: disallow-untyped-decorators=False | ||
|
||
import logging | ||
from typing import Dict, Sequence, Tuple, Union | ||
|
||
from torch.fx.node import Argument, Target | ||
from torch_tensorrt.dynamo._SourceIR import SourceIR | ||
from torch_tensorrt.dynamo.conversion import impl | ||
from torch_tensorrt.dynamo.conversion._ConversionContext import ConversionContext | ||
from torch_tensorrt.dynamo.conversion._ConverterRegistry import ( | ||
dynamo_tensorrt_converter, | ||
) | ||
from torch_tensorrt.dynamo.conversion.converter_utils import load_tensorrt_llm | ||
from torch_tensorrt.dynamo.lowering.passes.fuse_distributed_ops import ( | ||
tensorrt_fused_nccl_all_gather_op, | ||
tensorrt_fused_nccl_reduce_scatter_op, | ||
) | ||
|
||
import tensorrt as trt | ||
|
||
_LOGGER: logging.Logger = logging.getLogger(__name__) | ||
|
||
if load_tensorrt_llm(): | ||
|
||
@dynamo_tensorrt_converter(tensorrt_fused_nccl_all_gather_op) | ||
def fused_nccl_gather( | ||
ctx: ConversionContext, | ||
target: Target, | ||
args: Tuple[Argument, ...], | ||
kwargs: Dict[str, Argument], | ||
name: str, | ||
) -> Union[trt.ITensor, Sequence[trt.ITensor]]: | ||
return impl.distributed.nccl_gather( | ||
ctx, | ||
target, | ||
SourceIR.ATEN, | ||
name, | ||
[args[0]], | ||
) | ||
|
||
@dynamo_tensorrt_converter(tensorrt_fused_nccl_reduce_scatter_op) | ||
def fused_nccl_reduce_scatter( | ||
ctx: ConversionContext, | ||
target: Target, | ||
args: Tuple[Argument, ...], | ||
kwargs: Dict[str, Argument], | ||
name: str, | ||
) -> Union[trt.ITensor, Sequence[trt.ITensor]]: | ||
return impl.distributed.nccl_reduce_scatter( | ||
ctx, | ||
target, | ||
SourceIR.ATEN, | ||
name, | ||
[args[0]], | ||
) | ||
|
||
breakpoint() | ||
else: | ||
_LOGGER.debug( | ||
"Did not load torch.distributed converters since TensorRT-LLM is not available" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.