Skip to content

Commit 0a449b1

Browse files
committed
feat: Disable require_full_compilation in torch compile
1 parent 6919f72 commit 0a449b1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

py/torch_tensorrt/dynamo/partitioning/_adjacency_partitioner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,12 @@ def partition(
270270

271271
# Construct
272272
supported_ops = OpSupportTester(torch_executed_ops=torch_executed_ops)
273-
partitioner = TRTPartitioner(gm, supported_ops, min_block_size=min_block_size)
273+
partitioner = TRTPartitioner(
274+
gm,
275+
supported_ops,
276+
min_block_size=min_block_size,
277+
require_full_compilation=require_full_compilation,
278+
)
274279

275280
partitioned_graph = partitioner.partition_graph()
276281

py/torch_tensorrt/dynamo/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ def parse_dynamo_kwargs(kwargs: Any) -> CompilationSettings:
184184
# Parse input runtime specification
185185
settings.use_python_runtime = use_python_runtime_parser(settings.use_python_runtime)
186186

187+
# Ignore and warn about require_full_compilation flag
188+
if settings.require_full_compilation:
189+
logger.warning(
190+
"Detected require_full_compilation=True for a torch.compile run. "
191+
"This option has no effect in torch.compile."
192+
)
193+
settings.require_full_compilation = False
194+
187195
logger.info("Compilation Settings: %s\n", settings)
188196

189197
return settings

0 commit comments

Comments
 (0)