Skip to content

Commit e5096fc

Browse files
committed
final revision
1 parent 08841a1 commit e5096fc

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/build-test-windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
pushd .
136136
cd tests/py/dynamo
137137
../../../packaging/vc_env_helper.bat python -m pytest -ra -n 8 --junitxml=${RUNNER_TEST_RESULTS_DIR}/l0_dynamo_core_runtime_tests_results.xml runtime/test_000_*
138-
../../../packaging/vc_env_helper.bat python -m pytest -ra -n 8 --junitxml=${RUNNER_TEST_RESULTS_DIR}/l0_dynamo_core_partitioning_tests_results.xml partitioning/
138+
../../../packaging/vc_env_helper.bat python -m pytest -ra -n 8 --junitxml=${RUNNER_TEST_RESULTS_DIR}/l0_dynamo_core_partitioning_tests_results.xml partitioning/test_000_*
139139
../../../packaging/vc_env_helper.bat python -m pytest -ra -n 8 --junitxml=${RUNNER_TEST_RESULTS_DIR}/l0_dynamo_core_lowering_tests_results.xml lowering/
140140
popd
141141
@@ -219,6 +219,7 @@ jobs:
219219
pushd .
220220
cd tests/py/dynamo
221221
../../../packaging/vc_env_helper.bat python -m pytest -ra -n 8 --junitxml=${RUNNER_TEST_RESULTS_DIR}/l1_dynamo_core_tests_results.xml runtime/test_001_*
222+
../../../packaging/vc_env_helper.bat python -m pytest -ra -n 8 --junitxml=${RUNNER_TEST_RESULTS_DIR}/l1_dynamo_core_partitioning_tests_results.xml partitioning/test_001_*
222223
popd
223224
224225
L1-dynamo-compile-tests:

py/torch_tensorrt/dynamo/partitioning/_resource_partitioner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
logger = logging.getLogger(__name__)
6161

62-
MAX_NUM_OF_ENGINES = 40
62+
MAX_NUM_OF_ENGINES = 50
6363
ENGINE_COMPILATION_MEMORY_USAGE_MULTIPLIER = 4
6464

6565

@@ -127,6 +127,9 @@ def partition_graph(self) -> torch.fx.GraphModule:
127127
subgraphs, subgraph_size_budget=self.calculate_size_budget()
128128
)
129129

130+
if len(subgraphs) == 1:
131+
return self.module
132+
130133
# Set the number of TRT engines to be generated
131134
self.num_trt_accelerated_subgraphs = len([s for s in subgraphs if s.is_acc])
132135

@@ -315,7 +318,7 @@ def break_subgraph_by_size(
315318
)
316319
new_subgraphs = self.step_and_validate(new_subgraphs, step_size)
317320
size_0, size_1 = self.size_of_subgraphs(new_subgraphs)
318-
if size_0 > size_to_break:
321+
if size_0 > size_to_break or size_0 > size_1:
319322
break
320323

321324
return new_subgraphs, size_0, size_1

tests/py/dynamo/partitioning/test_001_resource_partitioning.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def forward(self, x):
166166
)
167167

168168
partitioned_module = resource_partition(
169-
partitioned_module, cpu_memory_budget=1.7 * 1024 * 1024 * 1024 # 1.7GB,
169+
partitioned_module, cpu_memory_budget=1.4 * 1024 * 1024 * 1024 # 1.4GB,
170170
)
171171

172172
assert (
@@ -177,8 +177,8 @@ def forward(self, x):
177177
if "_run_on_acc" in name
178178
]
179179
)
180-
> 3
181-
), "The graph should have more than 3 accelerated subgraphs"
180+
== 5
181+
), "The graph should have 5 accelerated subgraphs"
182182
assert (
183183
len(
184184
[
@@ -298,7 +298,7 @@ def forward(self, x):
298298
)
299299

300300
partitioned_module = resource_partition(
301-
partitioned_module, cpu_memory_budget=1.7 * 1024 * 1024 * 1024 # 1.7GB,
301+
partitioned_module, cpu_memory_budget=1.4 * 1024 * 1024 * 1024 # 1.4GB,
302302
)
303303

304304
assert (
@@ -396,7 +396,7 @@ def forward(self, x):
396396
)
397397

398398
partitioned_module = resource_partition(
399-
partitioned_module, cpu_memory_budget=1.7 * 1024 * 1024 * 1024 # 1.7GB,
399+
partitioned_module, cpu_memory_budget=1.4 * 1024 * 1024 * 1024 # 1.4GB,
400400
)
401401

402402
assert (

0 commit comments

Comments
 (0)