Fix: Episode freeze with staggered agent death in multi-agent environments#2
Open
yoosunghong wants to merge 1 commit intoGPUOpen-LibrariesAndSDKs:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, I would like to express my sincere gratitude for your dedication to this project. Schola has been an invaluable tool for my research.
While using it, I identified a minor issue in a multi-agent setup and prepared a potential fix. I'm not sure if this is the best approach, but I wanted to share it in hopes that it might be useful. I would greatly appreciate any feedback you may have.
Problem
In multi-agent environments using Schola + RLlib with
NEXT_STEPautoreset, agents dying at different timesteps cause two compounding failures:Step()receives an incomplete action map, causing the environment to stall.Step()could overwritebTerminatedflags back to false, preventingAllAgentsCompleted()from ever returning true.Root Cause
RayEnv.step): Raw RLlib actions (live agents only) were forwarded directly without padding for dead agents.AbstractGymConnector):Step()was called with all received actions, allowing environment implementations to accidentally clear terminal flags on dead agents.Fix Details
Python Side (
schola/rllib/env.py)_make_noop_action(): Generates zero-valued actions matching any action space structure.RayEnvandRayVecEnvnow pad previously-dead agents with no-op actions.C++ Side (
AbstractGymConnector.cpp)NextStepbranch, it now snapshots terminal agents beforeStep()and builds aLiveActionsmap.Testing & Verification
Unit Tests (No Unreal Required)
__all__computation.Integration Test (UE5.6 Environment)
Verified against a real UE5.6 environment with 3 agents dying at steps 5, 10, and 15.
📝 Compliance Checklist