ray.util.state.获取放置组#

ray.util.state.get_placement_group(id: str, address: str | None = None, timeout: int = 30, _explain: bool = False) PlacementGroupState | None[源代码]#

通过ID获取放置组。

参数:
  • id – 放置组的ID

  • address – Ray 引导地址,可以是 autolocalhost:6379。如果为 None,它将从已初始化的 Ray 中自动解析。

  • timeout – 状态API请求的最大超时值。

  • _explain – 打印API信息,如API延迟或失败的查询信息。

返回:

如果未找到执行者,则为 None,否则为 PlacementGroupState

抛出:

RayStateApiException – 如果CLI未能查询数据。

开发者API: 此API可能会在Ray的次要版本之间发生变化。