[错误] 多输出扩散展开:每个样本的轨迹会压缩为输出 0,分组前进时会发生 AttributeError,提供的潜在量跳过封装
作者: CjhHa1创建于 2026年8月7日更新于 2026年9月17日
Bug 1 — all K samples in a multi-output group report output 0's rollout trajectory
Severity: silent numerical corruption. No exception, no warning; training just stops learning.
A num_outputs_per_prompt=K request runs as K per-output forwards, each producing its own rollout_trajectory_data from its own x_T slice and per-step SDE noise. Two sites then collapse those K distinct trajectories into K copies of output 0's:
gpu_worker.py:882-886—_merge_expanded_singletonskeeps the trajectory of the first per-output batch only:
if (
merged.rollout_trajectory_data is None
and output_batch.rollout_trajectory_data is not None
):
merged.rollout_trajectory_data = output_batch.rollout_trajectory_dataNote the asymmetry: output, trajectory_latents, noise_pred and trajectory_decoded are all concatenated along the batch dim in _finalize_expanded_parts. Only rollout_trajectory_data is treated as a singleton.
2. diffusion_generator.py:516 — _result_common slices samples and metrics per output_index (metrics_list[output_index] at line 502) but hands the
内容来源: sgl-project/sglang