Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
samruds committed Mar 20, 2024
1 parent dda6485 commit d78726e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/unit/sagemaker/serve/utils/test_hardware_detector.py
Expand Up @@ -66,7 +66,7 @@ def test_get_gpu_info_describe_instance_types_throws(sagemaker_session, boto_ses
"Error": {
"Code": "InvalidInstanceType",
"Message": f"An error occurred (InvalidInstanceType) when calling the DescribeInstanceTypes "
f"operation: The following supplied instance types do not exist: [{INVALID_INSTANCE_TYPE}]",
f"operation: The following supplied instance types do not exist: [{INVALID_INSTANCE_TYPE}]",
}
},
"DescribeInstanceTypes",
Expand Down Expand Up @@ -104,15 +104,16 @@ def test_format_instance_type_without_ml_success():
@patch("sagemaker.serve.utils.hardware_detector.estimate_command_parser")
@patch("sagemaker.serve.utils.hardware_detector.gather_data")
def test_total_inference_model_size_mib(
mock_gather_data,
mock_parser,
mock_gather_data,
mock_parser,
):
mock_parser.return_value = Mock()
mock_gather_data.return_value = [[1, 1, 1, 1]]
product = MIB_CONVERSION_FACTOR * 1 * MEMORY_BUFFER_MULTIPLIER

assert hardware_detector._total_inference_model_size_mib("stable-diffusion", "float32") == \
product
assert (
hardware_detector._total_inference_model_size_mib("stable-diffusion", "float32") == product
)

mock_parser.return_value = Mock()
mock_gather_data.return_value = None
Expand Down

0 comments on commit d78726e

Please sign in to comment.