From ad68337b70b3eb5eeae939efadaae8d005331c05 Mon Sep 17 00:00:00 2001 From: aoshen02 Date: Fri, 5 Jun 2026 01:48:21 +0000 Subject: [PATCH] test/sync: port #1975 engine-agnostic riders (data.py debug-assert widen + parallel_check sweep) Mirror slime #1975 (the 2 engine-agnostic riders only; version/build_conda/v0.5.12.post1 patch-dirs = N/A for vime): - data.py: widen rollout sanity asserts (log_probs -0.5->-1, entropy 0.5->1) - test_qwen3_0.6B_parallel_check.py: simplify TP/PP/CP sweep [1,2,4,8]->[1,2,4] via parallel_sizes + product<=num_gpus guard. #1985/#1986 NOT included here: their target test files are introduced by mega-A/B/C/G (not yet in main) -> must sequence after those mega-PRs merge. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/test_qwen3_0.6B_parallel_check.py | 13 ++++--------- vime/backends/megatron_utils/data.py | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/test_qwen3_0.6B_parallel_check.py b/tests/test_qwen3_0.6B_parallel_check.py index 3b8b5d6f7..f02e9499c 100644 --- a/tests/test_qwen3_0.6B_parallel_check.py +++ b/tests/test_qwen3_0.6B_parallel_check.py @@ -101,17 +101,12 @@ def execute(): num_gpus_per_node=NUM_GPUS, megatron_model_type=MODEL_TYPE, ) - # 8 GPU CPU 1 + parallel_sizes = [1, 2, 4] for num_gpus in [8, 4, 2]: - remaining_gpus = num_gpus - for tp_size in [1, 2, 4, 8]: - remaining_gpus /= tp_size + for tp_size in parallel_sizes: for pp_size in [1, 2, 4]: - if remaining_gpus < pp_size: - continue - remaining_gpus /= pp_size - for cp_size in [1, 2, 4, 8]: - if remaining_gpus < cp_size: + for cp_size in parallel_sizes: + if tp_size * pp_size * cp_size > num_gpus: continue args = train_args + ( f"--load-debug-rollout-data data-{i}.pt " diff --git a/vime/backends/megatron_utils/data.py b/vime/backends/megatron_utils/data.py index de6c62d55..dee37edf8 100644 --- a/vime/backends/megatron_utils/data.py +++ b/vime/backends/megatron_utils/data.py @@ -472,9 +472,9 @@ def log_rollout_data( # assert reduced_log_dict["rollout/log_probs"] == reduced_log_dict["rollout/ref_log_probs"] assert abs(reduced_log_dict["rollout/log_probs"] - reduced_log_dict["rollout/ref_log_probs"]) < 1e-8 if "rollout/log_probs" in reduced_log_dict: - assert -0.5 < reduced_log_dict["rollout/log_probs"] < 0 + assert -1 < reduced_log_dict["rollout/log_probs"] < 0 if "rollout/entropy" in reduced_log_dict: - assert 0 < reduced_log_dict["rollout/entropy"] < 0.5 + assert 0 < reduced_log_dict["rollout/entropy"] < 1 if args.log_multi_turn: log_multi_turn_data(rollout_id, args, rollout_data)