[feat] Add HunyuanVideo 1.5 embedding preprocessing pipeline - #1663
[feat] Add HunyuanVideo 1.5 embedding preprocessing pipeline#1663klhhhhh wants to merge 11 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI
🔴 PR merge requirementsWaiting for
This rule is failing.
|
Pre-commit checks failedHi @klhhhhh, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
|
The training side that consumes this is #1662. |
|
Kun Lin — pushed three commits' worth of changes to your branch rather than sending a list back. Revert anything you disagree with. The blocker. The three new fields break the five existing overfit preprocess scripts. All five succeed on base, so it's a regression. The LTX2 and Kandinsky5 nightly overfit e2e tests invoke these scripts directly; fastcheck stays green because it doesn't run nightly. Fixed by switching them to Two smaller ones:
Verified: ruff clean on every changed file, Credit where it's due — sizing the empty-ByT5 placeholder from Two things I left alone: Note this PR and #1662 form a contract in both directions — see the comment there. |
…ed schema pa.table(mapping, schema=...) requires the mapping to contain every field in the schema; nullable=True does not exempt it. The five overfit preprocess scripts build their mapping from their own record keys, so adding the three text_embedding_2 columns makes all five raise: KeyError: "The passed mapping doesn't contain the following field(s) of the schema: text_embedding_2_bytes, text_embedding_2_shape, text_embedding_2_dtype" Verified: all five raise at this branch's head and succeed on base. The LTX2 and Kandinsky5 nightly overfit e2e tests invoke these scripts directly, so the nightly lane breaks at the parquet-write step while fastcheck stays green. records_to_table() already exists for exactly this and goes through from_pylist, which fills absent keys with null. The new hunyuan15 script already sidesteps the problem by iterating the schema with .get(); this propagates the same idea to its siblings. Confirmed the resulting table is schema-identical and the collator skips the null column. Also: - torch.empty -> torch.zeros for a zero-byte payload with a non-empty declared shape. A truncated row used to fail loudly in stack(); with empty() it silently stacks uninitialized memory. - Replace the nullability assertion, which could not fail: nullable=True is pyarrow's default for pa.field, so it holds for every field in every schema and would still hold with the explicit flag deleted. It now asserts the behavior that actually matters -- a pre-secondary-encoder record raises with the old pattern and round-trips with records_to_table.
DATA_DIR and OUTPUT_DIR were module constants, so the only usable paths were
the documented recipe's. Anything automated -- a nightly test, a second
experiment -- had to write into data/hunyuan15_overfit{,_preprocessed} and
would clobber whatever clips and captions a user had prepared there. The
Kandinsky5 nightly carries a warning about exactly this: an earlier cleanup in
that test deleted the real recipe's directories.
Same defaults, now overridable by environment variable.
ba01de2 to
b7f7f66
Compare
|
@SolitaryThinker, Thanks for the detailed review and fixes! I’ve addressed the remaining points by adding the parquet round-trip tests for the dual text embeddings, including the empty ByT5 case, and removing the unused |
Summary
This PR adds the embedding preprocessing pipeline for HunyuanVideo 1.5 training and extends the existing T2V dataset pipeline to support dual text encoders.
Changes
Dual text embedding support
text_embedding_2_*fields for the ByT5 encoder while keeping backward compatibility with the existing dataset format.shape=[0, hidden_size]) instead of removing the field, allowing downstream components to handle all samples through a unified data format.HunyuanVideo 1.5 embedding preprocessing
Validation