mirror of
https://github.com/wassname/ray.git
synced 2026-07-02 13:06:49 +08:00
[rllib] Replace ray.get() with ray_get_and_free() to optimize memory usage (#4586)
This commit is contained in:
@@ -17,6 +17,7 @@ from ray.rllib.utils.annotations import override
|
||||
from ray.rllib.utils.compression import pack_if_needed
|
||||
from ray.rllib.utils.timer import TimerStat
|
||||
from ray.rllib.utils.schedules import LinearSchedule
|
||||
from ray.rllib.utils.memory import ray_get_and_free
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -89,7 +90,7 @@ class SyncReplayOptimizer(PolicyOptimizer):
|
||||
with self.sample_timer:
|
||||
if self.remote_evaluators:
|
||||
batch = SampleBatch.concat_samples(
|
||||
ray.get(
|
||||
ray_get_and_free(
|
||||
[e.sample.remote() for e in self.remote_evaluators]))
|
||||
else:
|
||||
batch = self.local_evaluator.sample()
|
||||
|
||||
Reference in New Issue
Block a user