code: def _serial_benchmark(
      predictor: PredictorBase, sample_input: object
  ) -> tuple:
      """Placeholder docstring"""
      latencies = []
      tokens_per_seconds = []
  
      for _ in range(WARMUP):
          predictor.predict(sample_input)
  
      logger.info("")
      logger.info(
          "=============== Running Serial Benchmark.... ================"
      )
      for itr in range(INVOCATIONS):
          elapsed_time, tokens_per_second = _timed_invoke(
              predictor.predict, sample_input
          )
  
          logger.info(
              "Invocation: %s => Latency: %s, Tokens/s: %s",
              itr,
              elapsed_time,
              tokens_per_second,
          )
  
          tokens_per_seconds.append(tokens_per_second)
          latencies.append(elapsed_time)
      logger.info(
          "================ Completed Serial Benchmark =================\n"
      )
  
      avg_latency = sum(latencies) / len(latencies)
      avg_tokens_per_second = sum(tokens_per_seconds) / len(
          tokens_per_seconds
      )
  
      return (
          avg_latency,
          percentile(latencies, 90),
          avg_tokens_per_second,
      )
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/utils/tuning.py
imports: from __future__ import absolute_import
  import logging
  from time import perf_counter
  import collections
  from multiprocessing.pool import ThreadPool
  from math import ceil
  import pandas
  from numpy import percentile, std
  from sagemaker.serve.model_server.djl_serving.utils import _tokens_from_chars, _tokens_from_words
  from sagemaker.base_predictor import PredictorBase
label_desc: Use image node_id 5 for calling a global function with example usage: _serial_benchmark(predictor, sample_input) and returns: avg_latency,  percentile,  avg_tokens_per_second