Skip to content

Fail fast on empty action shuffle blocks#67

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/empty-action-shuffle-blocks
Open

Fail fast on empty action shuffle blocks#67
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/empty-action-shuffle-blocks

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • raise a clear error when the action shuffle dataset has no shuffle blocks
  • add a regression test covering the empty-block case without pulling in the heavy dataset package imports

Root cause

ActionIterableShuffleDataset.__iter__() enters an infinite while True loop even when get_shuffle_blocks() returns an empty list. In that case torch.randperm(0) produces no indices, so the iterator yields nothing, increments epochs forever, and can leave workers hanging without a useful failure signal.

Validation

  • uvx ruff check /Users/hoangvu/Code/OSS/cosmos-framework/cosmos_framework/data/vfm/action/datasets/action_sft_dataset.py /Users/hoangvu/Code/OSS/cosmos-framework/tests/action_sft_dataset_test.py
  • uvx ruff format --check /Users/hoangvu/Code/OSS/cosmos-framework/cosmos_framework/data/vfm/action/datasets/action_sft_dataset.py /Users/hoangvu/Code/OSS/cosmos-framework/tests/action_sft_dataset_test.py
  • PYTHONPATH=/Users/hoangvu/Code/OSS/cosmos-framework uvx pytest --noconftest /Users/hoangvu/Code/OSS/cosmos-framework/tests/action_sft_dataset_test.py -o addopts=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant