Skip to content

Implement load_into for the shared_ptr data loader #11562

Open
@JacobSzwejbka

Description

@JacobSzwejbka

🚀 The feature, motivation and pitch

load_into is used if mutable state has a meaningful initial value. This primarily happens with on-device training but could also happen if some model had read before write state that we serialized an initial value for.

For this task we need to implement this function https://github.com/pytorch/executorch/blob/main/runtime/core/data_loader.h#L111 in https://github.com/pytorch/executorch/blob/main/extension/data_loader/shared_ptr_data_loader.h

example of implementation in filedataloader https://github.com/pytorch/executorch/blob/main/extension/data_loader/file_data_loader.h#L75

Then add a corresponding test to https://github.com/pytorch/executorch/blob/main/extension/data_loader/test/shared_ptr_data_loader_test.cpp

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @larryliu0820 @lucylq

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersmodule: runtimeIssues related to the core runtime and code under runtime/module: trainingIssues related to training models on edge devices

    Type

    No type

    Projects

    Status

    To triage

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions