Fix: Reduce GPU batch size in test config to prevent dataset length calculation error#65
Merged
AlexanderFengler merged 1 commit intomainfrom Dec 15, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
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.
While testing LANfactory's compatibililty with Python 3.13.* I ran into an issue: The
test_torch_train_cli_smoketest fails when CUDA is available because the current GPU batch size (50,000) exceeds the number of samples per file in the test data (20,000). This caused theDatasetTorch.__len__()method to return 0, which made PyTorch'sRandomSamplerfail with:Root Cause
In
DatasetTorch.__len__(), the calculation:Results in 0 when
batch_size > samples_per_filedue to integer division.With the test configuration:
(1 * ((20000 // 50000) * 50000)) // 50000 = 0Solution
Reduced
GPU_BATCH_SIZEfrom 50,000 to 5,000 in config_network_training_lan.yaml. This ensures the batch size is smaller than the number of samples per file, allowing the dataset to have a positive length while still testing GPU functionality.Note
The
test_jax_train_cli_smoketest was passing because JAX defaults to CPU in the test environment, using the smallerCPU_BATCH_SIZEof 1,000.