Comments (5)
using yield
, not return
, can not work too !
https://docs.ray.io/en/latest/data/api/doc/ray.data.Dataset.map_batches.html
import numpy as np
import ray
class Embedding(object):
"""
embedding
"""
def __call__(self, item):
"""
ray call
"""
for i in range(0, 100):
yield {'vector': np.random.uniform(low=0.5, high=13.3, size=(68000,)).tolist()}
@ray.remote(num_cpus=0)
def debug():
ds = ray.data.from_items(list(range(0, 200)))
ds = ds.map_batches(
Embedding,
batch_size=10,
concurrency=(1, 4),
num_cpus=0,
)
for item in ds.iter_batches():
pass
if __name__ == '__main__':
future = debug.remote()
ray.get(future)
ray.shutdown()
from ray.
try to kill by pid can release the memory
import numpy as np
import ray
import ray.runtime_context
class Embedding(object):
"""
embedding
"""
def __call__(self, item):
"""
ray call
"""
for i in range(0, 100):
yield {'vector': np.random.uniform(low=0.5, high=13.3, size=(380,)).tolist()}
@ray.remote(num_cpus=0)
def debug():
ds = ray.data.from_items(list(range(0, 200)))
ds = ds.map_batches(
Embedding,
batch_size=10,
concurrency=(1, 4),
num_cpus=0,
)
for item in ds.iter_batches():
pass
return ray.runtime_context.get_runtime_context().get_worker_id()
if __name__ == '__main__':
future = debug.remote()
worker_id = ray.get(future)
import os
import signal
import time
from ray.experimental.state.api import get_worker
worker = get_worker(worker_id)
pid = worker.pid
ray.shutdown()
time.sleep(10)
os.kill(pid, signal.SIGKILL)
from ray.
Hey @happyxhw, looks like this is expected behavior: https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395
from ray.
Hey @happyxhw, looks like this is expected behavior: https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395
I have read this discussion. I know "ray::IDLE" is something similar to a progress in a pool. But in this issue the "ray::IDLE" is dead without a "ID". It never goes away while consuming too much memory, and can not be reused forever.
from ray.
I ran the reproduction script with Ray 2.9.2, but I wasn't able to reproduce the issue. All of the IDLE processes have a PID.
@rynewang do you have a hunch about what might be going on here?
from ray.
Related Issues (20)
- [tune] `tune.with_resources` with `PlacementGroupFactory` cannot find GPUs in `train_fn` HOT 4
- CI test linux://python/ray/dashboard:test_dashboard is consistently_failing HOT 5
- CI test linux://rllib:examples/checkpoints/checkpoint_by_custom_criteria is flaky HOT 5
- [Core] Returning an object that is >100KB from an Actor with max_task_retries>0 leaks IDLE workers HOT 1
- CI test linux://python/ray/train:deepspeed_torch_trainer_no_raydata is consistently_failing HOT 1
- CI test linux://doc:source/serve/doc_code/distilbert is consistently_failing HOT 2
- CI test linux://doc:source/serve/doc_code/distilbert is consistently_failing HOT 1
- [<Ray Data>] Import Error using ray.data.read_bigquery
- [Core] `ray.get_runtime_context().namespace` returns incorrect namespace in Actor Tasks HOT 5
- Release test serve_scale_replicas.aws failed HOT 2
- Release test chaos_dataset_shuffle_push_based_sort_1tb.aws failed HOT 1
- Release test serve_autoscaling_load_test.aws failed HOT 4
- RLlib Custom Gymnasium Example Fails HOT 6
- [RLlib] missing __init__ file
- RayService GCS not able to use AWS Elastic Cache Serverless Instance configured with Encryption in Flight (TLS) HOT 2
- [<Ray component: Core|RLlib|etc...>] HOT 1
- [Data] Support task reassignment in actor_pool_map_operator to improve fault tolerance
- [serve] strict enforcement of max ongoing requests doesn't work with lightweight update
- [Data] Ray Data prematurely closes progress bar
- [Train][Tune] Add stacklevel for all `logger.warning` calls.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ray.