Skip to content

Sharded dataset generation#73

Open
PatrickRMiles wants to merge 13 commits into
LBANN:mainfrom
PatrickRMiles:miles30/sharded_sample_generation
Open

Sharded dataset generation#73
PatrickRMiles wants to merge 13 commits into
LBANN:mainfrom
PatrickRMiles:miles30/sharded_sample_generation

Conversation

@PatrickRMiles

Copy link
Copy Markdown
Collaborator

Summary

Adds v3 physical sharded dataset generation and loading, with shard files written to match the configured DistConv layout. This lets large samples be generated directly as per-rank physical shards instead of always writing full-volume samples, and should allow us to generate scale 11 data.

Changes

  • Generate one set of voxelized fractal indices per logical volume, then render all requested physical shards from that shared data.
  • Write v3 dataset metadata containing the physical shard layout and shard-suffixed volume/mask files.
  • Load v3 physical shard files directly when the dataset layout matches the requested DistConv layout.
  • Preserve v2/full-volume dataset loading for unsharded cache reuse and runtime slicing.
  • Canonicalize v3 cache IDs for equivalent shard layouts so reordered dc_num_shards / dc_shard_dims pairs reuse the same dataset cache.

Validation

  • Ran sharded dataset equivalence comparisons across problem scales 6, 7, and 8 for layouts 1x1x1, 1x1x2, 1x2x2, and 1x1x4; all 18 pairwise comparisons passed.

@PatrickRMiles PatrickRMiles marked this pull request as draft May 28, 2026 04:46
@PatrickRMiles PatrickRMiles marked this pull request as ready for review June 10, 2026 20:21
@PatrickRMiles PatrickRMiles force-pushed the miles30/sharded_sample_generation branch from 2ad7850 to a6697cf Compare June 10, 2026 21:34
Comment thread ScaFFold/configs/benchmark_testing.yml

@michaelmckinsey1 michaelmckinsey1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand when unsharded "V2" datasets would be used? When would those be used? When under scale 11?

In general I think we should discuss the use of keeping around V1 and V2 support. Is it even feasible to fully migrate to V3 and deprecate?

Comment on lines +88 to +103
def _point_cloud_path(config, curr_category: int, curr_instance: int) -> str:
"""Return the input point-cloud path for a fractal instance."""

instances_dir = f"var{config.variance_threshold}/instances/np{config.point_num}"
return os.path.join(
str(config.fract_base_dir),
instances_dir,
f"{curr_category:06d}",
f"{curr_category:06d}_{curr_instance:04d}.npy",
)


def _local_shape(slices):
"""Return the local spatial shape described by shard slices."""

return tuple(s.stop - s.start for s in slices)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For helpers that are invoked only once, I think we remove them and write the code inline. This PR is already adding many functions so I think the readability is decreased when over factoring.

@PatrickRMiles

PatrickRMiles commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

I don't understand when unsharded "V2" datasets would be used? When would those be used? When under scale 11?

In general I think we should discuss the use of keeping around V1 and V2 support. Is it even feasible to fully migrate to V3 and deprecate?

@michaelmckinsey1 I figured leaving V2 support in would be good so we can reuse existing datasets. It does add complexity though, so I'm happy to remove it if you're cool with regenerating datasets for existing problem configs. I suppose since we already have good data up to scale 10, there won't be much opportunity to reuse existing V2 datasets anyway...

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.

2 participants