Add more useful trace and validation against position embeddings#302
Open
10LGUO wants to merge 2 commits into
Open
Add more useful trace and validation against position embeddings#30210LGUO wants to merge 2 commits into
10LGUO wants to merge 2 commits into
Conversation
…g bounds at startup Today when a dataset image exceeds the corresponding pixel limit, the data pipeline generates position IDs beyond the table size, which triggers a silent CUDA device-side assertion. This assertion kills the process with SIGABRT, giving no Python-level stack trace and no indication of which config value is wrong, , which is hard for coding agent to debug on the first go. The constraints are: VAE path: max_image_size ≤ max_latent_size × vae_image_downsample VIT path: vit_max_image_size ≤ vit_max_num_patch_per_side × vit_patch_size TRAIN.md already notes "if max_latent_size is not set correctly, an out-of-bounds error may occur", but there was no code-level guard. This commit adds a preflight check on rank 0 immediately after the dataset config is loaded. It raises a descriptive ValueError before any GPU work starts, telling the user exactly which dataset and which values are in conflict and how to fix them. co-authored by: Claude Code.
Fallback to image_transform_args caused a false-positive ValueError on datasets like t2i_pretrain that have no VIT path. Only check VIT bounds when vit_image_transform_args is explicit or the dataset is a known VLM type.
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.
Today when a dataset image exceeds the corresponding pixel limit, the data pipeline generates position IDs beyond the table size, which triggers a silent CUDA device-side assertion. This assertion kills the process with SIGABRT, giving no Python-level stack trace and no indication of which config value is wrong, , which is hard for coding agent to debug on the first go.
The constraints are:
VAE path: max_image_size ≤ max_latent_size × vae_image_downsample
VIT path: vit_max_image_size ≤ vit_max_num_patch_per_side × vit_patch_size
TRAIN.md already notes "if max_latent_size is not set correctly, an out-of-bounds error may occur", but there was no code-level guard.
This commit adds a preflight check on rank 0 immediately after the dataset config is loaded. It raises a descriptive ValueError before any GPU work starts, telling the user exactly which dataset and which values are in conflict and how to fix them.
co-authored by Claude Code.