[RLlib] Issue 24074: multi-GPU learner thread key error in MA-scenarios. (#24382)

This commit is contained in:
Sven Mika 2022-05-02 18:30:46 +02:00 committed by GitHub
parent d4a906e177
commit 924adcf402
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,12 +209,16 @@ class _MultiGPULoaderThread(threading.Thread):
if not s.local_worker.is_policy_to_train(pid, batch):
continue
policy = policy_map[pid]
policy.load_batch_into_buffer(
batch=batch
if isinstance(batch, SampleBatch)
else batch.policy_batches[pid],
buffer_index=buffer_idx,
)
if isinstance(batch, SampleBatch):
policy.load_batch_into_buffer(
batch=batch,
buffer_index=buffer_idx,
)
elif pid in batch.policy_batches:
policy.load_batch_into_buffer(
batch=batch.policy_batches[pid],
buffer_index=buffer_idx,
)
# Tag just-loaded stack as "ready".
s.ready_tower_stacks.put(buffer_idx)