meta-pytorch / meta-pytorch/data

[Nodes] Add a ToDevice node, or combine with pin memory

Open
#1,407 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

nodes
Dominant language
Python
Stars
1.3k
Forks
179
Avg merge
6d 1h
Merged PRs (30d)
2

Description

🚀 The feature

We should add a node that will send batches to device (probably one at a time). We could either separate this, add it on to pre-fetcher (ie always call .to(device) on the head of the queue, or maybe part of pin-memory

Motivation, pitch

Sending data to device can be slow, and often users want this done in a background thread. DataLoader should do this in the backgroudn as it consolidates state management

Alternatives

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing pre-fetcher and pin-memory behavior, focusing on how DataLoader currently manages batches and device transfer. Compare the separate ToDevice-node proposal with combining device transfer into pre-fetching, and define the desired background-thread behavior before implementation. Done means the design choice is resolved and batches are transferred to the device as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.