Skip to content

Rename jni layer cpp files#17380

Open
mohammed-saalim wants to merge 4 commits intopytorch:mainfrom
mohammed-saalim:rename-jni-layer-cpp-files
Open

Rename jni layer cpp files#17380
mohammed-saalim wants to merge 4 commits intopytorch:mainfrom
mohammed-saalim:rename-jni-layer-cpp-files

Conversation

@mohammed-saalim
Copy link
Copy Markdown
Contributor

@mohammed-saalim mohammed-saalim commented Feb 11, 2026

Summary

Renamed JNI layer files to better align with their Java counterparts, improving the name mapping between JNI and Java layers as suggested in #10890.

Changes

  • Renamed jni_layer.cppjni_module.cpp
  • Renamed jni_layer_llama.cppjni_llm_module.cpp
  • Updated all references in:
    • extension/android/CMakeLists.txt
    • extension/android/jni/BUCK
    • extension/android/jni/selective_jni.buck.bzl
    • extension/android/jni/jni_layer_training.cpp

Testing

  • Verified zero remaining references to old filenames
  • All build file references updated correctly
  • Git history preserved via git mv

Fixes #10890

cc @kirklandsign @cbilgin

Copilot AI review requested due to automatic review settings February 11, 2026 18:12
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 11, 2026

🔗 Helpful Links

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

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:

❌ 3 New Failures, 2 Unrelated Failures

As of commit e89106e with merge base 89e6416 (image):

NEW FAILURES - The following jobs have failed:

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.

@meta-cla meta-cla 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 Feb 11, 2026
@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

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

Copy link
Copy Markdown
Contributor

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 renames the Android JNI C++ entrypoints to better align file names with their Java counterparts (per #10890), and updates build-system references accordingly.

Changes:

  • Renamed the core JNI source file reference from jni_layer.cpp to jni_module.cpp across Buck/CMake.
  • Renamed the LLM JNI source file reference from jni_layer_llama.cpp to jni_llm_module.cpp across Buck/CMake.
  • Updated internal references/comments to reflect the new filenames.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extension/android/jni/selective_jni.buck.bzl Updates selective JNI target to point at jni_module.cpp.
extension/android/jni/jni_module.cpp New/renamed core JNI implementation file.
extension/android/jni/jni_llm_module.cpp New/renamed LLM JNI implementation file.
extension/android/jni/jni_layer_training.cpp Updates comment referencing the renamed core JNI file.
extension/android/jni/BUCK Updates Buck build targets to use renamed JNI sources and export the new filename.
extension/android/CMakeLists.txt Updates CMake sources list to use renamed JNI sources.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Feb 12, 2026

@kirklandsign has imported this pull request. If you are a Meta employee, you can view this in D93154524.

Copilot AI review requested due to automatic review settings February 13, 2026 23:58
@mohammed-saalim
Copy link
Copy Markdown
Contributor Author

is there something i should work on? @kirklandsign

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 4 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kirklandsign
Copy link
Copy Markdown
Contributor

Could you please fix the lint error?

@nil-is-all
Copy link
Copy Markdown
Contributor

Hi @mohammed-saalim, thanks for the PR. Please do address the errors and fixes suggested in the lint runner and submit for review again. Thanks!

@mohammed-saalim mohammed-saalim force-pushed the rename-jni-layer-cpp-files branch from 76ae0e6 to 223231b Compare February 19, 2026 19:48
@mohammed-saalim
Copy link
Copy Markdown
Contributor Author

can u check now pls?

@kirklandsign
Copy link
Copy Markdown
Contributor

Hi @mohammed-saalim also there is a merge conflict

@mohammed-saalim mohammed-saalim force-pushed the rename-jni-layer-cpp-files branch from 223231b to bc02639 Compare March 9, 2026 21:24
Copilot AI review requested due to automatic review settings March 9, 2026 21:24
@mohammed-saalim
Copy link
Copy Markdown
Contributor Author

Hi @kirklandsign @nil-is-all, sorry for the delay! I've addressed the feedback:

  • ✅ Fixed the cmake-format lint error
  • ✅ Resolved merge conflicts by rebasing onto latest main

Ready for re-review when you get a chance. Thanks!

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 4 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nil-is-all nil-is-all added the module: android Issues related to Android code, build, and execution label Mar 25, 2026
@kirklandsign
Copy link
Copy Markdown
Contributor

@mohammed-saalim sorry new merge conflicts

@nil-is-all
Copy link
Copy Markdown
Contributor

@mohammed-saalim, sorry to ping again, could you look at the merge conflicts and let us know again?

Renamed JNI layer files to better align with their Java counterparts:
- jni_layer.cpp -> jni_module.cpp
- jni_layer_llama.cpp -> jni_llm_module.cpp

Updated all references in build files (CMakeLists.txt, BUCK, selective_jni.buck.bzl)
and comments to reflect the new names.

Fixes pytorch#10890
@mohammed-saalim mohammed-saalim force-pushed the rename-jni-layer-cpp-files branch from cdd6eef to c02da57 Compare April 14, 2026 01:00
@mohammed-saalim
Copy link
Copy Markdown
Contributor Author

Hey @kirklandsign @nil-is-all, apologies for the delay! Rebased onto latest main, no conflicts now. Ready for re-review. Thanks for your patience! Lemme know if u need something else

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. module: android Issues related to Android code, build, and execution

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[Android] Rename JNI cpp file

4 participants