mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[core] Log once when get_gpu_ids is called on driver. (#18282)
This commit is contained in:
parent
d43d297d9a
commit
9fa7951171
1 changed files with 6 additions and 4 deletions
|
@ -31,6 +31,7 @@ import ray._private.runtime_env as runtime_env_pkg
|
||||||
import ray._private.import_thread as import_thread
|
import ray._private.import_thread as import_thread
|
||||||
from ray.util.tracing.tracing_helper import import_from_string
|
from ray.util.tracing.tracing_helper import import_from_string
|
||||||
from ray.util.annotations import PublicAPI, DeveloperAPI, Deprecated
|
from ray.util.annotations import PublicAPI, DeveloperAPI, Deprecated
|
||||||
|
from ray.util.debug import log_once
|
||||||
import ray
|
import ray
|
||||||
import colorama
|
import colorama
|
||||||
import setproctitle
|
import setproctitle
|
||||||
|
@ -495,10 +496,11 @@ def get_gpu_ids():
|
||||||
worker.check_connected()
|
worker.check_connected()
|
||||||
|
|
||||||
if worker.mode != WORKER_MODE:
|
if worker.mode != WORKER_MODE:
|
||||||
logger.warning(
|
if log_once("worker_get_gpu_ids_empty_from_driver"):
|
||||||
"`ray.get_gpu_ids()` will always return the empty list when "
|
logger.warning(
|
||||||
"called from the driver. This is because Ray does not manage "
|
"`ray.get_gpu_ids()` will always return the empty list when "
|
||||||
"GPU allocations to the driver process.")
|
"called from the driver. This is because Ray does not manage "
|
||||||
|
"GPU allocations to the driver process.")
|
||||||
|
|
||||||
# TODO(ilr) Handle inserting resources in local mode
|
# TODO(ilr) Handle inserting resources in local mode
|
||||||
all_resource_ids = global_worker.core_worker.resource_ids()
|
all_resource_ids = global_worker.core_worker.resource_ids()
|
||||||
|
|
Loading…
Add table
Reference in a new issue