Skip to content

perf(data-plane): avoid local batch copies - #7

Open
rohitrango wants to merge 5 commits into
rohit/packedtensor_paddingfrom
rohit/packedtensor_opt
Open

rohitrango wants to merge 5 commits into
rohit/packedtensor_paddingfrom
rohit/packedtensor_opt

Conversation

@rohitrango

@rohitrango rohitrango commented Sep 10, 2026

Copy link
Copy Markdown
Owner

What does this PR do ?

Avoids unnecessary copies when fetching full or subset batches from the local data plane. It also preserves PackedTensor physical-segment deduplication across replica broadcasts so shared media is transferred once instead of being expanded per logical row.

Adds coverage that verifies full local fetches share tensor storage and replica broadcasts preserve PackedTensor row mappings, provenance, preprocessing configuration, and physical tensors.

This PR is stacked on NVIDIA-NeMo#4082 via `rohit/packedtensor_padding`.

Issues

None.

Usage

No user-facing API changes.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? No documentation changes are needed.

Additional Information

Validated on Slurm job `18295320` (`pool0-01445`):

```text
uv run --frozen --group test pytest --confcutdir=tests/unit/data_plane -q tests/unit/data_plane/test_leader_broadcast.py
```

Result: 5 passed. Ruff passed for all three changed files, and Pyrefly reported zero errors for both implementation files.

Signed-off-by: rohitrango <rohit.rango@gmail.com>
Signed-off-by: rohitrango <rohit.rango@gmail.com>
Signed-off-by: rohitrango <rohit.rango@gmail.com>
Signed-off-by: rohitrango <rohit.rango@gmail.com>
@rohitrango
rohitrango force-pushed the rohit/packedtensor_opt branch 2 times, most recently from 0bff7dc to a609bff Compare September 11, 2026 00:47
@rohitrango
rohitrango added this pull request to stack #9 September 11, 2026 03:21
Keep one-field-at-a-time staging while moving PackedTensor segments to the NCCL device before concatenation. This avoids the large CPU concatenation and subsequent flat host-to-device copy in worker fetch.

Signed-off-by: Rohit Jena <rohit.rango@gmail.com>
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