code: def get_worker_count(
      cls,
      runnable_class: t.Type[Runnable],
      resource_request: dict[str, t.Any] | None,
      workers_per_resource: int | float,
  ) -> int:
      if resource_request is None:
          resource_request = system_resources()
  
      # use nvidia gpu
      nvidia_gpus = get_resource(resource_request, "nvidia.com/gpu")
      if (
          nvidia_gpus is not None
          and len(nvidia_gpus) > 0
          and "nvidia.com/gpu" in runnable_class.SUPPORTED_RESOURCES
      ):
          return math.ceil(len(nvidia_gpus) * workers_per_resource)
  
      # use CPU
      cpus = get_resource(resource_request, "cpu")
      if cpus is not None and cpus > 0:
          if "cpu" not in runnable_class.SUPPORTED_RESOURCES:
              logger.warning(
                  "No known supported resource available for %s, falling back to using CPU.",
                  runnable_class,
              )
  
          if runnable_class.SUPPORTS_CPU_MULTI_THREADING:
              if isinstance(workers_per_resource, float):
                  raise ValueError(
                      "Fractional CPU multi threading support is not yet supported."
                  )
              return workers_per_resource
  
          return math.ceil(cpus) * workers_per_resource
  
      # this should not be reached by user since we always read system resource as default
      raise ValueError(
          f"No known supported resource available for {runnable_class}. Please check your resource request. "
          "Leaving it blank will allow BentoML to use system resources."
      )
  
file_path: BentoML/grpc-client/bentoml/_internal/runner/strategy.py
imports: from __future__ import annotations
  import abc
  import logging
  import math
  import typing
  from ..resource import get_resource
  from ..resource import system_resources
  from .runnable import Runnable
label_desc: Use image node_id 1 for calling the DefaultStrategy obj's underlying member method code with example usage: obj.get_worker_count(cls, runnable_class, resource_request, workers_per_resource) and returns: math, unknown, workers_per_resource