class_docstr: Internal datastructure wrapping config options for a deployment's replicas.
  
  Provides five main properties (see property docstrings for more info):
      deployment_def: the code, or a reference to the code, that this
          replica should run.
      init_args: the deployment_def's init_args.
      init_kwargs: the deployment_def's init_kwargs.
      ray_actor_options: the Ray actor options to pass into the replica's
          actor.
      resource_dict: contains info on this replica's actor's resource needs.
  
  Offers a serialized equivalent (e.g. serialized_deployment_def) for
  deployment_def, init_args, and init_kwargs. Deserializes these properties
  when they're first accessed, if they were not passed in directly through
  create().
  
  Use the classmethod create() to make a ReplicaConfig with the deserialized
  properties.
  
  Note: overwriting or setting any property after the ReplicaConfig has been
  constructed is currently undefined behavior. The config's fields should not
  be modified externally after it is created.
class_docstr_tok: ["Internal","datastructure","wrapping","config","options","for","a","deployment","'s","replicas",".","Provides","five","main","properties","(","see","property","docstrings","for","more","info",")",":","deployment_def",":","the","code",",","or","a","reference","to","the","code",",","that","this","replica","should","run",".","init_args",":","the","deployment_def","'s","init_args",".","init_kwargs",":","the","deployment_def","'s","init_kwargs",".","ray_actor_options",":","the","Ray","actor","options","to","pass","into","the","replica's","actor",".","resource_dict",":","contains","info","on","this","replica","'s","actor","'s","resource","needs",".","Offers","a","serialized","equivalent","(","e.g",".","serialized_deployment_def",")","for","deployment_def",",","init_args",",","and","init_kwargs",".","Deserializes","these","properties","when","they","'re","first","accessed",",","if","they","were","not","passed","in","directly","through","create","(",")",".","Use","the","classmethod","create","(",")","to","make","a","ReplicaConfig","with","the","deserialized","properties",".","Note",":","overwriting","or","setting","any","property","after","the","ReplicaConfig","has","been","constructed","is","currently","undefined","behavior",".","The","config","'s","fields","should","not","be","modified","externally","after","it","is","created","."]
code: def _validate_placement_group_options(self) -> None:
      if (
          self.placement_group_strategy is not None
          and self.placement_group_strategy
          not in VALID_PLACEMENT_GROUP_STRATEGIES
      ):
          raise ValueError(
              f"Invalid placement group strategy '{self.placement_group_strategy}'. "
              f"Supported strategies are: {VALID_PLACEMENT_GROUP_STRATEGIES}."
          )
  
      if (
          self.placement_group_strategy is not None
          and self.placement_group_bundles is None
      ):
          raise ValueError(
              "If `placement_group_strategy` is provided, `placement_group_bundles` "
              "must also be provided."
          )
  
      if self.placement_group_bundles is not None:
          if (
              not isinstance(self.placement_group_bundles, list)
              or len(self.placement_group_bundles) == 0
          ):
              raise ValueError(
                  "`placement_group_bundles` must be a non-empty list of resource "
                  'dictionaries. For example: `[{"CPU": 1.0}, {"GPU": 1.0}]`.'
              )
  
          for i, bundle in enumerate(self.placement_group_bundles):
              if (
                  not isinstance(bundle, dict)
                  or not all(isinstance(k, str) for k in bundle.keys())
                  or not all(
                      isinstance(v, (int, float))
                      for v in bundle.values()
                  )
              ):
                  raise ValueError(
                      "`placement_group_bundles` must be a non-empty list of "
                      "resource dictionaries. For example: "
                      '`[{"CPU": 1.0}, {"GPU": 1.0}]`.'
                  )
  
              # Validate that the replica actor fits in the first bundle.
              if i == 0:
                  bundle_cpu = bundle.get("CPU", 0)
                  replica_actor_num_cpus = self.ray_actor_options.get(
                      "num_cpus", 0
                  )
                  if bundle_cpu < replica_actor_num_cpus:
                      raise ValueError(
                          "When using `placement_group_bundles`, the replica actor "
                          "will be placed in the first bundle, so the resource "
                          "requirements for the actor must be a subset of the first "
                          "bundle. `num_cpus` for the actor is "
                          f"{replica_actor_num_cpus} but the bundle only has "
                          f"{bundle_cpu} `CPU` specified."
                      )
  
                  bundle_gpu = bundle.get("GPU", 0)
                  replica_actor_num_gpus = self.ray_actor_options.get(
                      "num_gpus", 0
                  )
                  if bundle_gpu < replica_actor_num_gpus:
                      raise ValueError(
                          "When using `placement_group_bundles`, the replica actor "
                          "will be placed in the first bundle, so the resource "
                          "requirements for the actor must be a subset of the first "
                          "bundle. `num_gpus` for the actor is "
                          f"{replica_actor_num_gpus} but the bundle only has "
                          f"{bundle_gpu} `GPU` specified."
                      )
  
                  replica_actor_resources = self.ray_actor_options.get(
                      "resources", {}
                  )
                  for (
                      actor_resource,
                      actor_value,
                  ) in replica_actor_resources.items():
                      bundle_value = bundle.get(actor_resource, 0)
                      if bundle_value < actor_value:
                          raise ValueError(
                              "When using `placement_group_bundles`, the replica "
                              "actor will be placed in the first bundle, so the "
                              "resource requirements for the actor must be a subset "
                              f"of the first bundle. `{actor_resource}` requirement "
                              f"for the actor is {actor_value} but the bundle only "
                              f"has {bundle_value} `{actor_resource}` specified."
                          )
  
imports: import inspect
  import json
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
  from google.protobuf.descriptor import FieldDescriptor
  from google.protobuf.message import Message
  from ray import cloudpickle
  from ray._private import ray_option_utils
  from ray._private.pydantic_compat import BaseModel, Field, NonNegativeFloat, NonNegativeInt, PositiveFloat, validator
  from ray._private.serialization import pickle_dumps
  from ray._private.utils import resources_from_ray_options
  from ray.serve._private.constants import DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_S, DEFAULT_GRACEFUL_SHUTDOWN_WAIT_LOOP_S, DEFAULT_HEALTH_CHECK_PERIOD_S, DEFAULT_HEALTH_CHECK_TIMEOUT_S, DEFAULT_MAX_CONCURRENT_QUERIES, MAX_REPLICAS_PER_NODE_MAX_VALUE
  from ray.serve._private.utils import DEFAULT, DeploymentOptionUpdateType
  from ray.serve.config import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import DeploymentConfig
  from ray.serve.generated.serve_pb2 import DeploymentLanguage
  from ray.serve.generated.serve_pb2 import EncodingType
  from ray.serve.generated.serve_pb2 import LoggingConfig
  from ray.serve.generated.serve_pb2 import ReplicaConfig
  from ray.util.placement_group import VALID_PLACEMENT_GROUP_STRATEGIES
label_desc: Use image node_id 8 for calling the ReplicaConfig obj's underlying member method code with example usage: obj._validate_placement_group_options() without return types