[Bug Fix] Hunyuan image cfg bugfix (#4752)

Signed-off-by: zhuhh97 <zhuhonghan@huawei.com>
Signed-off-by: dph97 <nenbaying@163.com>
Co-authored-by: zhuhh97 <z00806815@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Gao Han <hgaoaf@connect.ust.hk>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
authored and GitHub committed 2026-07-15 13:08:15 +08:00
1 parent 2d58070f60
commit f84f0e72fd
7 files changed
+132 -13

No files matched your search

@@ -856,8 +856,20 @@ class OmniKVTransferManager:
payloads.append(local_payload)
padding = None
if not branch_roles and cfg_size == 2 and main_payload:
# AR didn't split KV by branch; cfg follower needs the same
# positive KV for shared-prefix reuse. Only safe for cfg_size == 2:
# for cfg_size > 2 every rank must get its own KV, which we can't
# assign here, so padding stays None and the runner raises.
# Shallow dict copy: shares PKV tensors with main_payload. Safe
# only because the send path (cfg_scatter -> pack -> to_gpu_tensor)
# reads tensors to serialize, never mutates in place. Any async/
# KV-pool path that mutates req.past_key_values mid-scatter must
# clone tensors here instead.
padding = dict(main_payload)
while len(payloads) < cfg_size:
payloads.append(None)
payloads.append(padding)
return payloads[:cfg_size]