mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 07:34:30 +08:00
[rllib] Replace ray.get() with ray_get_and_free() to optimize memory usage (#4586)
This commit is contained in:
@@ -10,6 +10,7 @@ from ray.rllib.evaluation.sample_batch import SampleBatch
|
||||
from ray.rllib.utils.annotations import override
|
||||
from ray.rllib.utils.filter import RunningStat
|
||||
from ray.rllib.utils.timer import TimerStat
|
||||
from ray.rllib.utils.memory import ray_get_and_free
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -50,7 +51,7 @@ class SyncSamplesOptimizer(PolicyOptimizer):
|
||||
while sum(s.count for s in samples) < self.train_batch_size:
|
||||
if self.remote_evaluators:
|
||||
samples.extend(
|
||||
ray.get([
|
||||
ray_get_and_free([
|
||||
e.sample.remote() for e in self.remote_evaluators
|
||||
]))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user