Skip to content

fix(scripts): single-device sharding for compute_norm_stats torch path#999

Open
Bartok9 wants to merge 1 commit into
Physical-Intelligence:mainfrom
Bartok9:salvage/openpi-438-norm-stats-sharding
Open

fix(scripts): single-device sharding for compute_norm_stats torch path#999
Bartok9 wants to merge 1 commit into
Physical-Intelligence:mainfrom
Bartok9:salvage/openpi-438-norm-stats-sharding

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • Pass jax.sharding.SingleDeviceSharding(jax.devices()[0]) into TorchDataLoader when computing norm stats.

Motivation

On multi-GPU hosts, default mesh sharding cannot split batch_size=1 stats batches. Users previously had to set CUDA_VISIBLE_DEVICES.

Salvage of #438 by @tlpss — rebased to main (file structure now uses create_torch_dataloader helpers).

Verification

  • TorchDataLoader already accepts optional sharding=
  • RLDS path unchanged (shuffle=False already)

Attribution

Salvage of #438 by @tlpss — rebased to main

Salvage of Physical-Intelligence#438 by @tlpss — rebased to main.

Size-1 batches cannot shard across multi-GPU meshes; pin SingleDeviceSharding
for norm-stats collection convenience.
@jimmyt857
jimmyt857 removed their request for review July 11, 2026 19:37
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