Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tensorrt_llm/_torch/custom_ops/torch_custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
# BufferKind is bound from C++; see cpp/tensorrt_llm/thop/outputTensor.h (torch_ext::BufferKind).
from tensorrt_llm.bindings.internal.thop import BufferKind

deep_gemm.set_pdl(get_env_enable_pdl())


# Used to WAR an issue in torch.bmm that it would break the graph when the out is not contiguous.
@torch.library.custom_op("trtllm::bmm_out", mutates_args=("out", ))
Expand Down
16 changes: 16 additions & 0 deletions tensorrt_llm/_torch/pyexecutor/model_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,20 @@ def _filter_cuda_graph_batch_sizes(cuda_graph_batch_sizes: list[int],
return result


_DEEP_GEMM_PDL_CONFIGURED = False


def _configure_deep_gemm_pdl() -> None:
global _DEEP_GEMM_PDL_CONFIGURED
if _DEEP_GEMM_PDL_CONFIGURED:
Comment thread
lfr-0531 marked this conversation as resolved.
return

from tensorrt_llm import deep_gemm

deep_gemm.set_pdl(os.environ.get("TRTLLM_ENABLE_PDL", "1") == "1")
Comment thread
lfr-0531 marked this conversation as resolved.
_DEEP_GEMM_PDL_CONFIGURED = True


class PyTorchModelEngine(ModelEngine):

def __init__(
Expand All @@ -192,6 +206,8 @@ def __init__(
model_weights_memory_tag: Optional[str] = None,
model_weights_restore_mode=None,
):
_configure_deep_gemm_pdl()

self.forward_pass_callable = None
self.ub_buffers = None
(
Expand Down
Loading