Skip to content

Fix android instrumentation #10335

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 1 commit into from
Apr 21, 2025
Merged

Fix android instrumentation #10335

merged 1 commit into from
Apr 21, 2025

Conversation

kirklandsign
Copy link
Contributor

No description provided.

@kirklandsign kirklandsign requested a review from Copilot April 21, 2025 21:41
Copy link

pytorch-bot bot commented Apr 21, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 2 Pending, 1 Unrelated Failure

As of commit f97a0c2 with merge base cc3152b (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following job 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.

@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 21, 2025
@kirklandsign kirklandsign marked this pull request as ready for review April 21, 2025 21:41
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 fixes the android instrumentation by updating the signature and handling of the onStats method to work directly with the raw stats string.

  • Updated the onStats method signature to accept a JSON string instead of a pre-calculated float value.
  • Moved JSON parsing into the onStats method for centralized handling of statistics.

int promptEvalEndMs = jsonObject.getInt("prompt_eval_end_ms");
tps = (float) numGeneratedTokens / (inferenceEndMs - promptEvalEndMs) * 1000;
tokensPerSecond.add(tps);
} catch (JSONException e) {
Copy link
Preview

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

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

The empty catch block may hide JSON parsing errors, potentially making debugging more difficult. Consider logging the exception or handling it accordingly.

Suggested change
} catch (JSONException e) {
} catch (JSONException e) {
android.util.Log.e("LlmModuleInstrumentationTest", "Failed to parse JSON stats", e);

Copilot uses AI. Check for mistakes.

@kirklandsign kirklandsign merged commit 77c48f7 into main Apr 21, 2025
82 of 86 checks passed
@kirklandsign kirklandsign deleted the android-fix branch April 21, 2025 22:54
keyprocedure pushed a commit to keyprocedure/executorch that referenced this pull request Apr 21, 2025
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants