Skip to content

[1/N] Android JNI llama cache temperature in class #10287

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kirklandsign
Copy link
Contributor

@kirklandsign kirklandsign commented Apr 17, 2025

So far, for LLM, we can use the new config, with cached temperature from ctor. For llava, we use the old workflow.

Test: instrumentation test

Copy link

pytorch-bot bot commented Apr 17, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 2 Cancelled Jobs, 28 Unrelated Failures

As of commit c11f8dc with merge base d82e852 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@kirklandsign kirklandsign requested a review from Copilot April 17, 2025 23:27
@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 17, 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 caching for the temperature parameter in the Android JNI layer for llama models. The changes include adding a new member variable to store temperature, initializing that variable in the constructor, and updating the generation configuration to use the cached value.

  • Added a new member variable (temperature_) to cache the temperature.
  • Assigned the temperature parameter to temperature_ in the constructor.
  • Updated the generation configuration to use temperature_.
Comments suppressed due to low confidence (1)

extension/android/jni/jni_layer_llama.cpp:186

  • Please verify that removing the temperature parameter from the MTKLlamaRunner constructor is intentional. If the temperature was previously required by the runner, additional changes in MTKLlamaRunner or its usage may be needed.
tokenizer_path->toStdString().c_str());

@kirklandsign kirklandsign force-pushed the android-temperature-api branch from 18f75b1 to e26af08 Compare April 17, 2025 23:37
Base automatically changed from export-D73091676 to main April 18, 2025 01:55
@kirklandsign kirklandsign force-pushed the android-temperature-api branch from 9f6ee3b to 6dc4fc0 Compare April 18, 2025 02:34
Copy link

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@kirklandsign kirklandsign force-pushed the android-temperature-api branch from 6dc4fc0 to c11f8dc Compare April 19, 2025 00:09
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants