← Về thư mục
verl/single_controller/ray/base.py
- get_random_string · function · L29-L33 — def get_random_string(length: int) -> str
- func_generator · function · L36-L46 — def func_generator(self, method_name, dispatch_fn, collect_fn, execute_fn, blocking)
- func · function · L38-L44 — def func(args, *kwargs)
- RayResourcePool · class · L49-L88 — class RayResourcePool(ResourcePool)
- init · method · L51-L62 — def init(self, process_on_nodes: List[int] = None, use_gpu: bool = True, name_prefix: str = "", max_colocate_count: int = 5, detached=False) -> None
- get_placement_groups · method · L64-L88 — def get_placement_groups(self, strategy="STRICT_PACK", name=None)
- extract_pg_from_exist · function · L91-L111 — def extract_pg_from_exist(resource_pools: Dict[str, RayResourcePool], src_role_names: List[str], resource_pool: RayResourcePool) -> List
- merge_resource_pool · function · L114-L125 — def merge_resource_pool(rp1: RayResourcePool, rp2: RayResourcePool) -> RayResourcePool
- RayClassWithInitArgs · class · L128-L173 — class RayClassWithInitArgs(ClassWithInitArgs)
- init · method · L130-L134 — def init(self, cls, args, *kwargs) -> None: # self._options = kwargs.pop('options', dict())
- set_additional_resource · method · L136-L137 — def set_additional_resource(self, additional_resource)
- update_options · method · L139-L140 — def update_options(self, options: Dict)
- call · method · L142-L173 — def call(self, placement_group, placement_group_bundle_idx, use_gpu: bool = True, num_gpus=1, sharing_with=None) -> Any
- RayWorkerGroup · class · L176-L367 — class RayWorkerGroup(WorkerGroup)
- init · method · L178-L203 — def init(self, resource_pool: RayResourcePool = None, ray_cls_with_init: RayClassWithInitArgs = None, bin_pack: bool = True, name_prefix: str = None, detached=False, worker_names=None, **kwargs) -> None
- _is_worker_alive · method · L205-L207 — def _is_worker_alive(self, worker: ray.actor.ActorHandle)
- _init_with_detached_workers · method · L209-L212 — def _init_with_detached_workers(self, worker_names)
- _init_with_resource_pool · method · L214-L278 — def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, bin_pack, detached)
- worker_names · method · L281-L282 — def worker_names(self)
- from_detached · method · L285-L290 — def from_detached(cls, worker_names=None, ray_cls_with_init=None)
- spawn · method · L292-L317 — def spawn(self, prefix_set)
- _rebind_actor_methods · function · L298-L308 — def _rebind_actor_methods(worker_group, actor_name)
- execute_rank_zero_sync · method · L319-L320 — def execute_rank_zero_sync(self, method_name: str, args, *kwargs)
- execute_rank_zero_async · method · L322-L324 — def execute_rank_zero_async(self, method_name: str, args, *kwargs)
- execute_rank_zero · method · L326-L327 — def execute_rank_zero(self, method_name: str, args, *kwargs)
- execute_all · method · L329-L330 — def execute_all(self, method_name: str, args, *kwargs)
- execute_all_sync · method · L332-L333 — def execute_all_sync(self, method_name: str, args, *kwargs)
- execute_all_async · method · L335-L351 — def execute_all_async(self, method_name: str, args, *kwargs): # 这里我们假设,如果 args 和 kwargs 里面所有的参数都是 list,且所有的 list 长度都与 len(self._workers) 一致的话,我们会把 # list 中的每一个分别发到对应的 worker 上去 # print(f"execute_all_async: method {method_name}({args}, {kwargs})")
- master_address · method · L354-L355 — def master_address(self)
- master_port · method · L358-L359 — def master_port(self)
- workers · method · L362-L363 — def workers(self)
- world_size · method · L366-L367 — def world_size(self)
- _bind_workers_method_to_parent · function · L380-L411 — def _bind_workers_method_to_parent(cls, key, user_defined_cls)
- generate_function · function · L395-L401 — def generate_function(name)
- func · function · L397-L399 — def func(self, args, *kwargs): # dispatch to the actual worker
- _unwrap_ray_remote · function · L414-L417 — def _unwrap_ray_remote(cls)
- create_colocated_worker_cls · function · L420-L459 — def create_colocated_worker_cls(class_dict: dict[str, RayClassWithInitArgs])
- WorkerDict · class · L440-L450 — class WorkerDict(worker_cls)
- init · method · L442-L450 — def init(self)