Repository navigation
Conversation
The adapter's local ragged-L padding still zero-filled position_ids. Those ids are the KV-cache write slots, so delegate padding to HunyuanImage3FusedMultimodalCondition.concat.
The docstring hook rejects anything longer than a single line.
This branch has not been deployed
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.
Summary
hi3_fused_conditionsright-padded per-requestfused_mm_capturedicts with its own ragged-Lhelpers, and that copy still filledposition_idswith0. Those ids are upstream HunyuanImage3's KV-cache write slots, so a constant0pad writes every pad position of a short row onto cache slot 0.HunyuanImage3FusedMultimodalCondition.concatalready padsposition_idswith each row's continuing indices (#479). This deletes the adapter's_pad_to/_pad_attn_maskassembly and calls that concat.hi3_ar_fused_conditionsis unchanged.Related Issue
Fixes #525
Test Plan
CPU check of
hi3_fused_conditionsagainst the previous padding, on three ragged captures (L= 7 / 11 / 9, 2 rows each) and on two equal-length captures:input_ids,attention_mask,gen_image_mask, andgen_timestep_scatter_indexmatch the previous 0-pad assemblyposition_idspad is[7, 8, 9, 10]instead of[0, 0, 0, 0]; the length-9 row's pad is[9, 10]position_idsas0..4fused_mm_capturestill raises the existingRuntimeErrorNot run:
pre-commit; reason: the hook runner is not installed in this environment.Not run: GPU rollout or diffusion replay; reason: train-side replay calls
predict_noisewithout a KV cache, so thisposition_idschange has no numeric effect on the current path. The zero pad becomes a real KV overwrite only on a cached forward.Compatibility / Risk
No config, checkpoint, or API change. Ragged DiT captures now carry continuing
position_idsinstead of a0pad. Callers still receive{"fused": HunyuanImage3FusedMultimodalCondition}.Reviewer Notes
The deleted helpers had no other callers.
Hi3ImageOutputAdapterandHi3DitRecaptionOutputAdapteronly pass the returned dict through. An independent read of the diff found no blocking issues.AI-assisted implementation.
Checklist
Made with Cursor