Skip to content

Introduce APIs In Bundled Program to Not Take **Method** When Loading Input #10269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zhenyan-zhang-meta opened this issue Apr 17, 2025 · 0 comments
Assignees
Labels
module: extension Issues related to code under extension/

Comments

@zhenyan-zhang-meta
Copy link
Contributor

zhenyan-zhang-meta commented Apr 17, 2025

Context

This issue is the first step of #9638. In the discussion, we want to unblock having extension/module as the single source of implementation, which means that pybindings/pybindings should use extension/module rather than its own.

Specifically, the thing we need to unblock is that pybindings/pybindings needs to load bundled program, and the current BundledProgram APIs take method module as input (e.g. executorch::bundled_program::load_bundled_input), where Extension.module does not expose method class. Therefore we need to introduce new APIs to do the same job without exposing method, wrap as a form of BundledModule.

As a first step, we want to introduce a new API in BundledProgram to get bundled program input out of the program without taking method.

Proposal

The proposed change includes a utility function to the bundled program.

// in bundled_program.bundled_program.h

/**
  * Load testset_idx-th bundled input of method_name into given data_ptr 
  */
ET_NODISCARD ::executorch::runtime::Error get_bundled_input(
    SerializedBundledProgram* bundled_program_ptr,
    char* method_name,
    size_t testset_idx,
    void* data_ptr,
    size_t data_length);

With this API, we are able to unblocked implementation the bundled module wrapper for pybindings.

@zhenyan-zhang-meta zhenyan-zhang-meta self-assigned this Apr 17, 2025
@GregoryComer GregoryComer added the module: extension Issues related to code under extension/ label Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: extension Issues related to code under extension/
Projects
None yet
Development

No branches or pull requests

2 participants