Unverified Commit fa6feee4 authored by Michael Shin's avatar Michael Shin Committed by GitHub
Browse files

chore: moved asyncio import to top of the file for planner test (#3001)


Signed-off-by: default avatarMichael Shin <michaelshin@users.noreply.github.com>
parent 895fb216
...@@ -9,6 +9,7 @@ testing load prediction, interpolation, or correction factors. ...@@ -9,6 +9,7 @@ testing load prediction, interpolation, or correction factors.
""" """
import argparse import argparse
import asyncio
import math import math
import os import os
...@@ -152,8 +153,6 @@ class TestReplicaCalculation: ...@@ -152,8 +153,6 @@ class TestReplicaCalculation:
planner.decode_interpolator.interpolate_itl.return_value = 10.0 planner.decode_interpolator.interpolate_itl.return_value = 10.0
# Run the calculation # Run the calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Extract the calculated values from the log calls or by checking the mock calls # Extract the calculated values from the log calls or by checking the mock calls
...@@ -217,8 +216,6 @@ class TestReplicaCalculation: ...@@ -217,8 +216,6 @@ class TestReplicaCalculation:
planner.decode_interpolator.interpolate_itl.return_value = 10.0 planner.decode_interpolator.interpolate_itl.return_value = 10.0
# Run the calculation # Run the calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Check the results # Check the results
...@@ -290,8 +287,6 @@ class TestReplicaCalculation: ...@@ -290,8 +287,6 @@ class TestReplicaCalculation:
planner.connector.reset_mock() planner.connector.reset_mock()
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Verify results # Verify results
...@@ -344,8 +339,6 @@ class TestReplicaCalculation: ...@@ -344,8 +339,6 @@ class TestReplicaCalculation:
planner.decode_interpolator.interpolate_itl.return_value = 10.0 planner.decode_interpolator.interpolate_itl.return_value = 10.0
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Verify that total GPU usage doesn't exceed budget # Verify that total GPU usage doesn't exceed budget
...@@ -401,8 +394,6 @@ class TestReplicaCalculation: ...@@ -401,8 +394,6 @@ class TestReplicaCalculation:
planner.decode_interpolator.interpolate_itl.return_value = 10.0 planner.decode_interpolator.interpolate_itl.return_value = 10.0
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Verify minimum constraints are respected # Verify minimum constraints are respected
...@@ -465,8 +456,6 @@ class TestReplicaCalculation: ...@@ -465,8 +456,6 @@ class TestReplicaCalculation:
) )
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Verify that correction factor was effectively clamped # Verify that correction factor was effectively clamped
...@@ -526,8 +515,6 @@ class TestReplicaCalculation: ...@@ -526,8 +515,6 @@ class TestReplicaCalculation:
planner.decode_interpolator.interpolate_itl.return_value = 10.0 planner.decode_interpolator.interpolate_itl.return_value = 10.0
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
# Should handle gracefully without crashing # Should handle gracefully without crashing
...@@ -590,8 +577,6 @@ class TestReplicaCalculation: ...@@ -590,8 +577,6 @@ class TestReplicaCalculation:
) # 4 GPUs per engine ) # 4 GPUs per engine
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
if planner.connector.set_component_replicas.called: if planner.connector.set_component_replicas.called:
...@@ -649,8 +634,6 @@ class TestReplicaCalculation: ...@@ -649,8 +634,6 @@ class TestReplicaCalculation:
planner.decode_interpolator.interpolate_itl.return_value = 10.0 planner.decode_interpolator.interpolate_itl.return_value = 10.0
# Run calculation # Run calculation
import asyncio
asyncio.run(planner.make_adjustments()) asyncio.run(planner.make_adjustments())
if planner.connector.set_component_replicas.called: if planner.connector.set_component_replicas.called:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment