Repository navigation
[RLlib] Footsies APPO: many small updates, real frozen-opponent weights, bounded game-server startup - #67594
Merged
pseudo-rnd-thoughts merged 2 commits intoNov 4, 2026
Conversation
…ts, bounded game-server startup The footsies APPO learning tests time out often: - Each Learner update used 4096 * num_env_runners = 81,920 env steps at lr 1e-4. The game server answers one env step per 60 FPS frame, so the policy got its first update after ~3 minutes, the target network never updated, and the test passed only when a 10-episode eval of a ~50% policy happened to exceed 0.8. - The frozen opponents got the main policy's weights only on the Learner. `Algorithm.set_state()` doesn't change the weights version, so the EnvRunners skipped them and trained against the opponent's random init. - If a game server never got ready, `start_game_server()` polled forever. Use 2048-step batches with 256-step minibatches, lr 5e-4 and frequent target network updates. Push the copied opponent weights to all EnvRunners. Bound the game server's readiness wait and relaunch a server that doesn't get ready. Don't raise on an eval round without a decisive episode. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artur Niederfahrenhorst <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request optimizes APPO training hyperparameters, refactors the game server startup logic with retries and timeouts, and ensures weights are pushed directly to the environment runner groups. The review feedback points out two important issues: a potential AttributeError if eval_env_runner_group is None, and a potential crash when calling process.kill() on an already terminated process.
…ils.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Artur Niederfahrenhorst <[email protected]>
pseudo-rnd-thoughts
approved these changes
Nov 4, 2026
pseudo-rnd-thoughts
enabled auto-merge (squash)
November 4, 2026 12:17
elliot-barn
pushed a commit
that referenced
this pull request
Nov 17, 2026
Before this PR: - No release test checks RLlib's process memory over a training run. Leaks in the Learner, AggregatorActors or EnvRunners only showed up in long customer jobs (e.g. the per-update leaks fixed in #67299 and #67300). - No RLlib release test runs Learners on separate nodes. After this PR: - New weekly release test `rllib_footsies_appo_memory_multi_node`: APPO on Footsies in self-play, so there is no reward target and the module set never changes. It runs on a 4-node cluster: a CPU head, 2 single-GPU nodes with one Learner and its 2 AggregatorActors each, and a CPU node, for 24 EnvRunners in total. - Every iteration, a probe actor on each node reads the USS of every Learner, AggregatorActor and EnvRunner process. After a 3-minute warmup, the test fits each process's USS over the remaining 7 minutes and fails if any slope exceeds its category's limit (Learners 50, AggregatorActors 100, EnvRunners 50 MiB/h). The max and median slope per category, and the sample and train throughput, are reported as perf metrics. - The Footsies env takes its type aliases from `ray.rllib.utils.typing` instead of pettingzoo, so the test runs on the bare ray-torch cu133 image. Calibration: 3 runs of the script on the L4 equivalent of the new compute config (2× g6.4xlarge + 2× m5.4xlarge), 43 readings over a 7-minute window each. Slopes per process, in MiB/h: | | Learners (6) | AggregatorActors (12) | EnvRunners (72) | |---|---|---|---| | range | 1.6 to 4.0 | 1.1 to 26.0 (all others ≤1.5) | −7.9 to 13.8 | | limit | 50 | 100 | 50 | Gate check (CPU, 8 EnvRunners): a control run passes (EnvRunners ≤19 MiB/h). The same run with each EnvRunner keeping 512 KiB per `sample()` call fails, flagging all 8 EnvRunners at +410 to +417 MiB/h. That's the injected rate. Note: until #67594 lands, about 1 in 300 game servers never gets ready at startup, and the launcher waits for it forever. In this test that shows up as a timeout; that PR bounds the wait and relaunches the server. Not a duplicate: no open PR adds an RLlib memory or multi-node release test. Testing: ran the script on Anyscale (nightly image) like the release harness does (`TEST_OUTPUT_JSON` set, all 4 nodes up first): the 3 calibration runs above, plus 2 runs that showed Tune needs shared storage on multi-node clusters (now `/mnt/cluster_storage`), plus the CPU gate check. The release-test entry validates against `release/ray_release/schema.json`, and `pre-commit run --files` passes. AI assistance (Claude Code) was used for the investigation, the experiments and the change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Artur Niederfahrenhorst <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Before this PR:
learning_tests_appo_footsies_*postmerge tests time out often. Each Learner update takes4096 * num_env_runners= 81,920 env steps atlr=1e-4, but the game server answers one env step per 60 FPS frame (~57 steps/s per EnvRunner). The policy gets its first gradient update after ~3 minutes, and the target network never updates. Against the frozen copy the training win rate stays at 0.5, so the test passes only when a 10-episode eval happens to exceed 0.8 (e.g. eval 0.81 at training win rate 0.49).MixManagerCallbackinitializes each new frozen opponent withAlgorithm.set_state(). The EnvRunners skip those weights because the weights version doesn't change ([RLlib] Advance weights version after unversioned module state updates #67131 fixes that in the Learner). The training EnvRunners therefore play the opponent's random init, while evaluation uses the real copy.FootsiesBinary.start_game_server()polls forever (no deadline, no liveness check, no gRPC timeout), and setup hangs until the 900 s timeout. In a stress test, 3 of 240 concurrent server starts never got ready.After this PR:
lr=5e-4,target_network_update_freq=0.5.MixManagerCallbackpushes the copied weights to all (eval) EnvRunners. An eval round without a decisive episode no longer raises aKeyError.Validation on Anyscale (nightly image + this PR's three files, no #67131), each seed the CI test's args in a fresh driver with a 900 s cap including startup:
learning_tests_appo_footsies_single_gpulearning_tests_appo_footsies_multi_gpulearning_tests_appo_footsies_single_gpu_no_aggregator_actorsmulti_gpuargs, 2 Learners on 2 nodes (1×L4 each) + CPU EnvRunner nodesStock master on a 1×L4 node passed 1 of 1 attempt by eval luck, and
+#67131alone failed in 1,500 s. A 4 h run on the 4-node cluster kept Learner, aggregator, EnvRunner and Algorithm memory flat. The game-server launcher fix started 360/360 servers in a stress test, relaunching one server twice.pre-commit run --filespasses on all three files.Not a duplicate: no open PR touches the footsies example. #67131 fixes the weights-version root cause in
Learner.set_state, and #67103 only fixes the league-based self-play callback; this PR doesn't depend on either.AI assistance (Claude Code) was used for the investigation, the experiments and the change.
🤖 Generated with Claude Code