Skip to content

Add automatic num_workers selection (parallel data loading) in CREDIT v2 #324

Description

@kevinyang-cky

(This issue evolves from discussion with @djgagne)

Context

In CREDIT v1, users must manually benchmark data loading and training times to select an appropriate num_workers value, aiming to keep GPUs always utilized.

Issue

Performing the manual benchmark requires modifying the source code and understanding PyTorch to correctly set the timing checkpoints—an obstacle for users without ML experience.

Possible Solution

Add an automatic estimation step in CREDIT v2 to determine num_workers.

A possible approach:

  • Run a short dry run (e.g., one batch)

  • Measure:

    • data loading time per batch
    • training step time
  • Estimate a num_workers value that avoids data loading becoming the bottleneck

  • Allow users to override if needed

Reference

Slide 12 in Dhamma and Charlie's PyTorch IO presentation (Oct 2025) shows how to derive num_workers from the relationship between data loading and training time.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions