Skip to content

Move transfer_tensors_to_device into utils/dist_utils#70

Open
sanjanag wants to merge 1 commit intolinkedin:masterfrom
sanjanag:dist-utils-transfer-helper
Open

Move transfer_tensors_to_device into utils/dist_utils#70
sanjanag wants to merge 1 commit intolinkedin:masterfrom
sanjanag:dist-utils-transfer-helper

Conversation

@sanjanag
Copy link
Copy Markdown
Contributor

Summary

transfer_tensors_to_device is generic dataclass-tensor plumbing — moving
it from run_solver into utils/dist_utils makes it reusable from
distributed setup code (which builds per-rank input args before any
run_solver call) without having to import from run_solver. Internal
behavior is unchanged; run_solver keeps using the same function via that
import.

Test plan

  • Existing tests pass (pytest tests/ --ignore=tests/distributed)
  • transfer_tensors_to_device importable from both
    dualip.utils.dist_utils (canonical) and dualip.run_solver (re-export)

The helper is generic dataclass-tensor plumbing that distributed setup
code outside run_solver also needs. Lift it into utils/dist_utils so
those callers don't have to import from run_solver, and keep run_solver
using the same function via that import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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