Skip to content

[Test] Align PPO role wiring tests with critic loading and CPU hosts - #2330

Open
matrix72c wants to merge 1 commit into
InternLM:mainfrom
matrix72c:fix/ppo-role-wiring-tests
Open

matrix72c wants to merge 1 commit into
InternLM:mainfrom
matrix72c:fix/ppo-role-wiring-tests

Conversation

@matrix72c

Copy link
Copy Markdown
Contributor

Summary

Two tests in tests/rl/test_ppo_role_wiring.py fail on current main:

  • TestCriticConstruction.test_critic_uses_host_fsdp_and_strict_load still asserts from_hf(path, strict=True). fix critic load #2310 intentionally changed the critic to the actor's non-strict load, so a checkpoint that carries MTP weights the critic does not build still loads. The test now asserts the current call and is renamed test_critic_uses_host_fsdp_and_actor_load.
  • TestRoleTrainUpdate.test_steps_scheduler_only_for_applied_updates reaches DEVICE_MODULE.reset_peak_memory_stats(), which torch.cpu does not have. The test now patches role_worker.DEVICE_MODULE, the same way the other CPU role tests in this file patch the accelerator module.

Only tests change; no library code is touched.

Test Plan

On a CPU-only host, pytest tests/rl/test_ppo_role_wiring.py gives 29 passed (2 failed before this change).

ProduceBatchResult impact: not affected (tests only).

test_critic_uses_host_fsdp_and_strict_load still expected strict=True
after InternLM#2310 aligned the critic with the actor's non-strict load, and
test_steps_scheduler_only_for_applied_updates reached
DEVICE_MODULE.reset_peak_memory_stats, which torch.cpu lacks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant