Skip to content

[Android] Add API to use new config #10346

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

Merged
merged 3 commits into from
Apr 24, 2025
Merged

Conversation

kirklandsign
Copy link
Contributor

No description provided.

Copy link

pytorch-bot bot commented Apr 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10346

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit c38ccd3 with merge base dfd3dbe (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@kirklandsign kirklandsign requested a review from Copilot April 22, 2025 00:42
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 22, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new API for configuring and using LLM modules on Android by adding a new constructor that accepts a configuration object (LlmModuleConfig) and a new generate method that takes an LlmGenerationConfig for token generation.

  • Introduces a new constructor for LlmModule that initializes the module using LlmModuleConfig.
  • Adds an overloaded generate method to support generation with configuration options via LlmGenerationConfig.
Comments suppressed due to low confidence (1)

extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java:62

  • [nitpick] Consider updating the Javadoc reference to LlmModuleConfig using {@link LlmModuleConfig} instead of #LlmModuleConfig for improved documentation linking and clarity.
/** Constructs a LLM Module for a model with given #LlmModuleConfig */

@kirklandsign kirklandsign marked this pull request as ready for review April 22, 2025 17:18
Base automatically changed from android-config-api to main April 22, 2025 17:58
@kirklandsign kirklandsign force-pushed the android-config-api-2 branch from 6918f67 to 5004fdd Compare April 22, 2025 18:05
@kirklandsign kirklandsign requested a review from Copilot April 22, 2025 18:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an API update to support new configuration options for LLM modules on Android, enabling easier configuration via dedicated config objects.

  • Introduces a new constructor accepting LlmModuleConfig.
  • Adds an overloaded generate method that takes an LlmGenerationConfig.
Comments suppressed due to low confidence (1)

extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java:62

  • [nitpick] Consider updating the Javadoc comment to remove the '#' symbol from '#LlmModuleConfig'. Using '{@code LlmModuleConfig}' or including an '@param config' for clarity would improve its readability.
/** Constructs a LLM Module for a model with given #LlmModuleConfig */

@kirklandsign kirklandsign requested a review from Copilot April 22, 2025 22:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new APIs for integrating configuration objects when constructing the LLM module and generating tokens.

  • Introduces a new constructor that accepts a LlmModuleConfig object.
  • Adds an overloaded generate() method that takes a LlmGenerationConfig object.
Comments suppressed due to low confidence (1)

extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java:62

  • [nitpick] Consider using the {@link LlmModuleConfig} Javadoc tag instead of '#LlmModuleConfig' for clearer documentation and better IDE support.
/** Constructs a LLM Module for a model with given #LlmModuleConfig */

@kirklandsign kirklandsign force-pushed the android-config-api-2 branch from 764fbd6 to 64dde98 Compare April 24, 2025 00:56
@kirklandsign kirklandsign added the release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.) label Apr 24, 2025
@kirklandsign kirklandsign requested a review from Copilot April 24, 2025 00:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new API that supports configuration objects to initialize and generate outputs in LlmModule.

  • Added a new constructor accepting LlmModuleConfig.
  • Added an overloaded generate method that uses LlmGenerationConfig.

@facebook-github-bot
Copy link
Contributor

@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…/executorch/extension/llm/LlmModule.java

Co-authored-by: Copilot <[email protected]>
@facebook-github-bot
Copy link
Contributor

@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot merged commit 59dce3d into main Apr 24, 2025
84 of 85 checks passed
@facebook-github-bot facebook-github-bot deleted the android-config-api-2 branch April 24, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants