|
9 | 9 | """ |
10 | 10 |
|
11 | 11 | import argparse |
| 12 | +import asyncio |
12 | 13 | import math |
13 | 14 | import os |
14 | 15 |
|
@@ -152,8 +153,6 @@ async def mock_get_workers_info(): |
152 | 153 | planner.decode_interpolator.interpolate_itl.return_value = 10.0 |
153 | 154 |
|
154 | 155 | # Run the calculation |
155 | | - import asyncio |
156 | | - |
157 | 156 | asyncio.run(planner.make_adjustments()) |
158 | 157 |
|
159 | 158 | # Extract the calculated values from the log calls or by checking the mock calls |
@@ -217,8 +216,6 @@ async def mock_get_workers_info(): |
217 | 216 | planner.decode_interpolator.interpolate_itl.return_value = 10.0 |
218 | 217 |
|
219 | 218 | # Run the calculation |
220 | | - import asyncio |
221 | | - |
222 | 219 | asyncio.run(planner.make_adjustments()) |
223 | 220 |
|
224 | 221 | # Check the results |
@@ -290,8 +287,6 @@ async def mock_get_workers_info(): |
290 | 287 | planner.connector.reset_mock() |
291 | 288 |
|
292 | 289 | # Run calculation |
293 | | - import asyncio |
294 | | - |
295 | 290 | asyncio.run(planner.make_adjustments()) |
296 | 291 |
|
297 | 292 | # Verify results |
@@ -344,8 +339,6 @@ async def mock_get_workers_info(): |
344 | 339 | planner.decode_interpolator.interpolate_itl.return_value = 10.0 |
345 | 340 |
|
346 | 341 | # Run calculation |
347 | | - import asyncio |
348 | | - |
349 | 342 | asyncio.run(planner.make_adjustments()) |
350 | 343 |
|
351 | 344 | # Verify that total GPU usage doesn't exceed budget |
@@ -401,8 +394,6 @@ async def mock_get_workers_info(): |
401 | 394 | planner.decode_interpolator.interpolate_itl.return_value = 10.0 |
402 | 395 |
|
403 | 396 | # Run calculation |
404 | | - import asyncio |
405 | | - |
406 | 397 | asyncio.run(planner.make_adjustments()) |
407 | 398 |
|
408 | 399 | # Verify minimum constraints are respected |
@@ -465,8 +456,6 @@ async def mock_get_workers_info(): |
465 | 456 | ) |
466 | 457 |
|
467 | 458 | # Run calculation |
468 | | - import asyncio |
469 | | - |
470 | 459 | asyncio.run(planner.make_adjustments()) |
471 | 460 |
|
472 | 461 | # Verify that correction factor was effectively clamped |
@@ -526,8 +515,6 @@ async def mock_get_workers_info(): |
526 | 515 | planner.decode_interpolator.interpolate_itl.return_value = 10.0 |
527 | 516 |
|
528 | 517 | # Run calculation |
529 | | - import asyncio |
530 | | - |
531 | 518 | asyncio.run(planner.make_adjustments()) |
532 | 519 |
|
533 | 520 | # Should handle gracefully without crashing |
@@ -590,8 +577,6 @@ async def mock_get_workers_info(): |
590 | 577 | ) # 4 GPUs per engine |
591 | 578 |
|
592 | 579 | # Run calculation |
593 | | - import asyncio |
594 | | - |
595 | 580 | asyncio.run(planner.make_adjustments()) |
596 | 581 |
|
597 | 582 | if planner.connector.set_component_replicas.called: |
@@ -649,8 +634,6 @@ async def mock_get_workers_info(): |
649 | 634 | planner.decode_interpolator.interpolate_itl.return_value = 10.0 |
650 | 635 |
|
651 | 636 | # Run calculation |
652 | | - import asyncio |
653 | | - |
654 | 637 | asyncio.run(planner.make_adjustments()) |
655 | 638 |
|
656 | 639 | if planner.connector.set_component_replicas.called: |
|
0 commit comments