Skip to content
Open
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
8 changes: 8 additions & 0 deletions py/torch_tensorrt/dynamo/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import warnings
from typing import Any, Collection, List, Optional, Sequence, Set, Tuple, Union

import psutil
import torch
from torch.export import ExportedProgram
from torch.fx.node import Target
Expand Down Expand Up @@ -694,6 +695,13 @@ def compile(
else DiskEngineCache(engine_cache_dir, engine_cache_size)
)

if cpu_memory_budget and cpu_memory_budget > psutil.virtual_memory().available:
logger.warning(
f"CPU memory budget is greater than the available memory: {cpu_memory_budget} > {psutil.virtual_memory().available}"
"\nUsing the available memory instead."
)
cpu_memory_budget = psutil.virtual_memory().available

compilation_options = {
"enabled_precisions": (
enabled_precisions if enabled_precisions else _defaults.ENABLED_PRECISIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def forward(self, x):
current_subgraph = []
# Split the subgraph into two subgraphs by the ReLU node, which breaks the fusion group.
for node in subgraphs[0].nodes:
if node.op == "call_function" and node.target == aten.relu.default:
if node.op == "call_function" and "relu" in str(node.target):
new_subgraphs.append(Subgraph(is_acc=True, nodes=current_subgraph))
current_subgraph = []
current_subgraph.append(node)
Expand Down
Loading