Skip to content

Android application crash - Missing operator: [4] aten::native_dropout.out #1287

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

Closed
adonnini opened this issue Nov 27, 2023 · 17 comments
Closed
Assignees
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@adonnini
Copy link

Hi,
After loading my model for inference in my Android application via executorch runtime library, the application crashes.

Below you will find the logcat with all the information regarding the crash.

Please let me know if you need any other information, and what I should do next.

Thanks

LOGCAT

11-24 09:35:10.445: I/NeuralNetworkService(3388):  - NeuralNetworkServiceRunnable - neuralNetworkInputPreparationRunning - 1 - 0
11-24 09:35:10.445: I/NeuralNetworkService(3388):  - NeuralNetworkServiceRunnable - neuralNetworkLoadAndRunRunning - 0 - 0
11-24 09:35:10.445: I/NeuralNetworkService(3388):  - NeuralNetworkServiceRunnable - About to run neuralNetworkloadAndRun --- 
11-24 09:35:10.445: I/NeuralNetworkService(3388):  - neuralNetworkloadAndRunPytorch - Running - 
11-24 09:35:10.445: I/NeuralNetworkService(3388):  - neuralNetworkloadAndRunPytorch - locationInformationDir - /data/user/0/com.android.contextq/files/locationInformation/
11-24 09:35:10.445: I/NeuralNetworkService(3388):  - neuralNetworkloadAndRunPytorch - savedNetworkArchiveLength - 120679184
11-24 09:35:10.445: I/NeuralNetworkService(3388):  - neuralNetworkloadAndRunPytorch - Abut to load module --- 
11-24 09:35:10.676: W/adbd(20118): timeout expired while flushing socket, closing
11-24 09:35:10.699: I/ETLOG(3388): Model file /data/user/0/com.android.contextq/files/locationInformation/tfmodel_exnnpack.pte is loaded.
11-24 09:35:10.699: I/ETLOG(3388): Setting up planned buffer 0, size 22900384.
11-24 09:35:10.713: W/libc(3388): Access denied finding property "ro.hardware.chipname"
11-24 09:35:10.729: D/XNNPACK(3388): allocated 6144 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.729: D/XNNPACK(3388): created workspace of size 774176
11-24 09:35:10.730: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.733: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.737: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.741: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.741: D/XNNPACK(3388): reusing tensor id #4 memory for tensor id #3 Node #2 Softmax
11-24 09:35:10.741: D/XNNPACK(3388): created workspace of size 42368
11-24 09:35:10.741: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.745: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.746: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.761: D/XNNPACK(3388): allocated 4196352 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.775: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.779: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.779: D/XNNPACK(3388): reusing tensor id #4 memory for tensor id #3 Node #2 Softmax
11-24 09:35:10.779: D/XNNPACK(3388): created workspace of size 42368
11-24 09:35:10.779: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.781: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.795: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.798: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.798: D/XNNPACK(3388): reusing tensor id #4 memory for tensor id #3 Node #2 Softmax
11-24 09:35:10.798: D/XNNPACK(3388): created workspace of size 42368
11-24 09:35:10.798: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.800: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.814: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.817: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.817: D/XNNPACK(3388): reusing tensor id #4 memory for tensor id #3 Node #2 Softmax
11-24 09:35:10.817: D/XNNPACK(3388): created workspace of size 42368
11-24 09:35:10.818: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.819: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.833: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.836: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.837: D/XNNPACK(3388): reusing tensor id #4 memory for tensor id #3 Node #2 Softmax
11-24 09:35:10.837: D/XNNPACK(3388): created workspace of size 42368
11-24 09:35:10.837: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.838: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.852: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.856: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.860: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.863: D/XNNPACK(3388): allocated 8192 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.863: D/XNNPACK(3388): created workspace of size 1327136
11-24 09:35:10.864: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.868: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.871: D/XNNPACK(3388): reusing tensor id #8 memory for tensor id #5 Node #2 Softmax
11-24 09:35:10.871: D/XNNPACK(3388): created workspace of size 42368
11-24 09:35:10.871: D/XNNPACK(3388): created workspace of size 663584
11-24 09:35:10.872: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.875: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.879: I/XNNPACK(3388): fuse Clamp Node #2 into upstream Node #1
11-24 09:35:10.880: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.895: D/XNNPACK(3388): allocated 4196352 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.910: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.914: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.917: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.923: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.925: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.929: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.932: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.934: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.949: D/XNNPACK(3388): allocated 4196352 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.963: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.967: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.971: D/XNNPACK(3388): created workspace of size 663584
11-24 09:35:10.971: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.975: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.979: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.983: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.986: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:10.987: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:10.990: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:10.992: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.005: D/XNNPACK(3388): created workspace of size 663584
11-24 09:35:11.006: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.010: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:11.010: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.014: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:11.015: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.029: D/XNNPACK(3388): created workspace of size 663584
11-24 09:35:11.030: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.033: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:11.034: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.037: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:11.039: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.052: D/XNNPACK(3388): created workspace of size 663584
11-24 09:35:11.053: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.056: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:11.057: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.060: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:11.062: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.076: D/XNNPACK(3388): created workspace of size 663584
11-24 09:35:11.076: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.080: D/XNNPACK(3388): created workspace of size 387104
11-24 09:35:11.080: D/XNNPACK(3388): allocated 1050624 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.084: I/XNNPACK(3388): fuse Clamp Node #1 into upstream Node #0
11-24 09:35:11.085: D/XNNPACK(3388): allocated 4202496 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.099: D/XNNPACK(3388): allocated 16416 bytes for packed weights in Fully Connected (NC, F32) operator
11-24 09:35:11.099: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.099: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.099: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.099: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.099: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.100: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.101: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): Missing operator: [4] aten::native_dropout.out
11-24 09:35:11.102: I/ETLOG(3388): There are 62 instructions don't have corresponding operator registered. See logs for details
11-24 09:35:11.113: I/ETLOG(3388): In function CheckOk(), assert failed: hasValue_
11-24 09:35:11.113: A/libc(3388): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 3424 (Thread-2), pid 3388 (lNetworkService)
11-24 09:35:11.307: I/crash_dump64(4913): obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
11-24 09:35:11.308: I/tombstoned(687): received crash request for pid 3424
11-24 09:35:11.309: I/crash_dump64(4913): performing dump of process 3388 (target tid = 3424)
11-24 09:35:11.328: E/DEBUG(4913): failed to read /proc/uptime: Permission denied
11-24 09:35:11.518: A/DEBUG(4913): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-24 09:35:11.518: A/DEBUG(4913): Build fingerprint: 'Fairphone/FP4eea/FP4:12/SKQ1.220201.001/SP2K:user/release-keys'
11-24 09:35:11.518: A/DEBUG(4913): Revision: '0'
11-24 09:35:11.518: A/DEBUG(4913): ABI: 'arm64'
11-24 09:35:11.518: A/DEBUG(4913): Timestamp: 2023-11-24 09:35:11.326798380+0100
11-24 09:35:11.518: A/DEBUG(4913): Process uptime: 0s
11-24 09:35:11.518: A/DEBUG(4913): Cmdline: com.android.contextq:ContextQNeuralNetworkService
11-24 09:35:11.518: A/DEBUG(4913): pid: 3388, tid: 3424, name: Thread-2  >>> com.android.contextq:ContextQNeuralNetworkService <<<
11-24 09:35:11.518: A/DEBUG(4913): uid: 10207
11-24 09:35:11.518: A/DEBUG(4913): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
11-24 09:35:11.518: A/DEBUG(4913):     x0  0000000000000000  x1  0000000000000d60  x2  0000000000000006  x3  0000007a52c3a380
11-24 09:35:11.518: A/DEBUG(4913):     x4  60651f7371647272  x5  60651f7371647272  x6  60651f7371647272  x7  7f7f7f7f7f7f7f7f
11-24 09:35:11.518: A/DEBUG(4913):     x8  00000000000000f0  x9  528a70e676eee5e2  x10 0000000000000000  x11 ffffff80fffffbdf
11-24 09:35:11.518: A/DEBUG(4913):     x12 0000000000000001  x13 0000000000000030  x14 0000007a52c39c98  x15 0000000034155555
11-24 09:35:11.518: A/DEBUG(4913):     x16 0000007de8ba6060  x17 0000007de8b82560  x18 0000007a4b690000  x19 0000000000000d3c
11-24 09:35:11.518: A/DEBUG(4913):     x20 0000000000000d60  x21 00000000ffffffff  x22 0000007df844f878  x23 0000007df844f878
11-24 09:35:11.518: A/DEBUG(4913):     x24 0000007a52c3ad20  x25 b400007c140960d0  x26 0000000000002071  x27 0000007df844f858
11-24 09:35:11.518: A/DEBUG(4913):     x28 0000007a52c3abf0  x29 0000007a52c3a400
11-24 09:35:11.518: A/DEBUG(4913):     lr  0000007de8b3295c  sp  0000007a52c3a360  pc  0000007de8b32988  pst 0000000000001000
11-24 09:35:11.518: A/DEBUG(4913): backtrace:
11-24 09:35:11.518: A/DEBUG(4913):       #00 pc 0000000000051988  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 369edc656806aeaf384cbeb8f7a347af)
11-24 09:35:11.518: A/DEBUG(4913):       #01 pc 0000000000b95590  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (et_pal_abort+8) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.518: A/DEBUG(4913):       #02 pc 0000000000b95398  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (torch::executor::runtime_abort()+8) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.518: A/DEBUG(4913):       #03 pc 0000000000b71c5c  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (torch::executor::Result<torch::executor::Method>::CheckOk() const+152) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.518: A/DEBUG(4913):       #04 pc 0000000000b6e110  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (torch::executor::Result<torch::executor::Method>::get()+24) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.518: A/DEBUG(4913):       #05 pc 0000000000b6bcf4  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (executorch_jni::ExecuTorchJni::ExecuTorchJni(facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >)+2000) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.519: A/DEBUG(4913):       #06 pc 0000000000b6b28c  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (facebook::jni::basic_strong_ref<facebook::jni::detail::HybridData, facebook::jni::LocalReferenceAllocator> facebook::jni::HybridClass<executorch_jni::ExecuTorchJni, facebook::jni::detail::BaseHybridClass>::makeCxxInstance<facebook::jni::alias_ref<_jstring*>&, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >&>(facebook::jni::alias_ref<_jstring*>&, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >&)+128) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.519: A/DEBUG(4913):       #07 pc 0000000000b6b07c  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (executorch_jni::ExecuTorchJni::initHybrid(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >)+52) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.519: A/DEBUG(4913):       #08 pc 0000000000b725a4  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (facebook::jni::detail::CallWithJniConversions<facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator> (*)(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >), facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator>, _jclass*, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> > >::call(_jclass*, _jstring*, facebook::jni::detail::JTypeFor<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>, facebook::jni::JObject, void>::_javaobject*, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator> (*)(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >))+136) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.519: A/DEBUG(4913):       #09 pc 0000000000b6b128  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (facebook::jni::detail::FunctionWrapper<facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator> (*)(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >), _jclass*, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> > >::call(_JNIEnv*, _jobject*, _jstring*, facebook::jni::detail::JTypeFor<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>, facebook::jni::JObject, void>::_javaobject*, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator> (*)(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >))+72) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.519: A/DEBUG(4913):       #10 pc 0000000000b6a718  /data/app/~~EP6W7rRpxDRUJZTsW7stdw==/com.android.contextq-_b84xlB4uDtvXTEvpbpsIw==/base.apk!libexecutorchdemo.so (facebook::jni::detail::FunctionWrapperWithJniEntryPoint<facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator> (*)(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >), &(executorch_jni::ExecuTorchJni::initHybrid(facebook::jni::alias_ref<_jclass*>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> >)), _jclass*, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::detail::HybridData, facebook::jni::JObject, void>::_javaobject*, facebook::jni::LocalReferenceAllocator>, facebook::jni::alias_ref<_jstring*>, facebook::jni::alias_ref<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString> > >::call(_JNIEnv*, _jobject*, _jstring*, facebook::jni::detail::JTypeFor<facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>, facebook::jni::JObject, void>::_javaobject*)+52) (BuildId: 8065dc692f8e345f80fe49a1f2162d7e784b3499)
11-24 09:35:11.519: A/DEBUG(4913):       #11 pc 000000000034aa30  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #12 pc 0000000000334280  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #13 pc 00000000005111fc  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+2364) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #14 pc 000000000049e470  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1840) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #15 pc 000000000034d1d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #16 pc 0000000000042ae0  /data/data/com.android.contextq/code_cache/.overlay/base.apk/classes11.dex (com.example.executorchdemo.executor.NativePeer.<init>+0)
11-24 09:35:11.519: A/DEBUG(4913):       #17 pc 0000000000378bb0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11907307138045539842)+232) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #18 pc 0000000000511d44  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #19 pc 000000000049e538  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+2040) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #20 pc 000000000034d1d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #21 pc 0000000000042a48  /data/data/com.android.contextq/code_cache/.overlay/base.apk/classes11.dex (com.example.executorchdemo.executor.Module.load+0)
11-24 09:35:11.519: A/DEBUG(4913):       #22 pc 0000000000378bb0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11907307138045539842)+232) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #23 pc 0000000000511d44  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #24 pc 000000000049e470  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1840) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #25 pc 000000000034d1d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #26 pc 0000000000042a2c  /data/data/com.android.contextq/code_cache/.overlay/base.apk/classes11.dex (com.example.executorchdemo.executor.Module.load+0)
11-24 09:35:11.519: A/DEBUG(4913):       #27 pc 0000000000378bb0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11907307138045539842)+232) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #28 pc 0000000000511d44  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #29 pc 000000000049e470  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1840) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #30 pc 000000000034d1d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #31 pc 000000000000d4f0  /data/data/com.android.contextq/code_cache/.overlay/base.apk/classes15.dex (com.android.contextq.neuralnetwork.NeuralNetworkService.neuralNetworkloadAndRunPytorch+0)
11-24 09:35:11.519: A/DEBUG(4913):       #32 pc 0000000000378bb0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11907307138045539842)+232) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #33 pc 0000000000511d44  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #34 pc 000000000049e470  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1840) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #35 pc 000000000034d1d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #36 pc 0000000000007d44  /data/data/com.android.contextq/code_cache/.overlay/base.apk/classes15.dex (com.android.contextq.neuralnetwork.NeuralNetworkService$NeuralNetworkServiceRunnable.run+0)
11-24 09:35:11.519: A/DEBUG(4913):       #37 pc 0000000000378bb0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11907307138045539842)+232) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #38 pc 0000000000511d44  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+5252) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #39 pc 000000000049efac  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4716) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #40 pc 000000000034d1d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #41 pc 000000000000308c  [anon:dalvik-/apex/com.android.art/javalib/core-oj.jar-transformed] (java.lang.Thread.run+0)
11-24 09:35:11.519: A/DEBUG(4913):       #42 pc 0000000000378bb0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11907307138045539842)+232) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #43 pc 00000000003784a8  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+964) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #44 pc 000000000034ab68  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #45 pc 0000000000333fa4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #46 pc 000000000023e4d4  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #47 pc 0000000000539a3c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1600) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-24 09:35:11.519: A/DEBUG(4913):       #48 pc 00000000000b6a24  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 369edc656806aeaf384cbeb8f7a347af)
11-24 09:35:11.519: A/DEBUG(4913):       #49 pc 00000000000532bc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 369edc656806aeaf384cbeb8f7a347af)
11-24 09:35:11.533: E/tombstoned(687): Tombstone written to: tombstone_16
@larryliu0820
Copy link
Contributor

cc @manuelcandalesnative_dropout.out seems not implemented in the portable library.

@adonnini
Copy link
Author

Hi @larryliu0820 thanks. I guess that means that until the issue is verified/fixed I cannot move forward with my work, right?
Any thoughts on timeframe for the resolution, even very rough/approximate?
Thanks

@kimishpatel
Copy link
Contributor

For inference optimization we should not really have dropout operator. @kirklandsign can you or someone write a pass to remove dropout?

@kimishpatel kimishpatel added bug triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Nov 28, 2023
@larryliu0820
Copy link
Contributor

For inference optimization we should not really have dropout operator. @kirklandsign can you or someone write a pass to remove dropout?

We should add this op into one of the existing passes, where we are removing a lot of other ops. On the other hand, is it possible that we are not telling PyTorch we are doing inference?

@adonnini can you confirm that you have used m.eval() or torch.no_grad()

@kimishpatel
Copy link
Contributor

On the other hand, is it possible that we are not telling PyTorch we are doing inference?

That is the reason why i suggest to have a separate pass, so as to make sure it is used for inference only.

@larryliu0820
Copy link
Contributor

On the other hand, is it possible that we are not telling PyTorch we are doing inference?

That is the reason why i suggest to have a separate pass, so as to make sure it is used for inference only.

Yeah if this is the case, point being we should give the user some warning to ask them to do m.eval() instead of removing the op ourselves

@adonnini
Copy link
Author

here is my executorch related code from my Android app.

As you will see code execution stops after the module is loaded. No other command is executed. Plea refer to the llogcat I sent in a previous comment where it seemsto indicate that the model was loaded.

Please let me know what I should do next.

Thanks

MY CODE

DATA PREPARATION

			float[] flat = flatten(tmpData);
			final long[] shapeArrDataPytorchFlattened = new long[]{1, flat.length};
			arrDataPytorch = Tensor.fromBlob(flat, shapeArrDataPytorchFlattened);
			locationInformationNeuralNetworkFeaturesFlattenedPytorch = Tensor.fromBlob(flat, shapeArrDataPytorchFlattened);

INFERENCE

		try {
// Load name of model file (yourModel.pth or .pt).

			String locationInformationDir = ContextqApp.getApplicationRef().getFilesDir().getAbsolutePath()+"/locationInformation/";
			Log.i(TAG, " - neuralNetworkloadAndRunPytorch - locationInformationDir - "+locationInformationDir);

			File savedNetworkArchive = new File(locationInformationDir+"tfmodel_exnnpack.pte");

			long savedNetworkArchiveLength = savedNetworkArchive.length();
			Log.i(TAG, " - neuralNetworkloadAndRunPytorch - savedNetworkArchiveLength - "+savedNetworkArchiveLength);

			String moduleFileAbsoluteFilePath = locationInformationDir+"tfmodel_exnnpack.pte";

			try {
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - Abut to load module --- ");
				mModule = Module.load(moduleFileAbsoluteFilePath);
			} catch (Exception e) {
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - Loading of module FAILED --- ");
				throw new RuntimeException(e);
			}

//NOTE CODE EXECUTION STOPS HERE. I KNOW THIS AS THE NEXT LOG STATEMENT (SEE BELOW) IS NOT GENERATED

			final Tensor outputTensor;

			float[] scores = new float[1];

			try {
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - Abut to run inference --- ");
				outputTensor = mModule.forward(from(arrDataPytorch)).toTensor();
//				outputTensor = mModule.forward(IValue.from(arrDataPytorch)).toTensor();
			} catch (Exception e) {
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - Inference FAILED --- ");
				throw new RuntimeException(e);
			}

			try {
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - Abut to get scores --- ");
				scores = outputTensor.getDataAsFloatArray();
//				final float[] scores = outputTensor.getDataAsFloatArray();
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - scores.toString() - "+scores.toString());
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - scores.length - "+scores.length);
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - scores - "+scores);
				for(int i = 0; i < scores.length; ++i)
				{
					Log.i(TAG, " - neuralNetworkloadAndRunPytorch - scores[i] - "+scores[i]);
				}
			} catch (Exception e) {
				Log.i(TAG, " - neuralNetworkloadAndRunPytorch - Getting scores FAILED --- ");
				throw new RuntimeException(e);
			}

			neuralNetworkInferenceResultProcessingPyTorch(scores);


		} catch(Exception e) {
			e.printStackTrace();
		}

@larryliu0820
Copy link
Contributor

@adonnini we are particularly interested in the AOT code where you prepare the model

@adonnini
Copy link
Author

@larryliu0820 I could give you the github for the model I used to base mine on. I did not change it significantly. I only adapted it to use my input dataset.
Would that work?

@manuelcandales
Copy link
Contributor

For inference optimization we should not really have dropout operator. @kirklandsign can you or someone write a pass to remove dropout?

Does this mean we don't need to add native_dropout to portable? By the way, that op is currently classified as a core op. Does this mean there are core ops that don't need to be added to the portable library?

@adonnini
Copy link
Author

Below is the code to create and save the model using executorch inside the training epoch loop (no validation).
Note that with each loop, the .pte files are overwritten. At this point, I am not concerned about that.
Please let me know what else you need


        ENCODER_IP_SIZE = encoder_ip_size
        DECODER_IP_SIZE = decoder_ip_size
        MODEL_OP_SIZE =  model_op_size
        EMB_SIZE = emb_size
        NUM_HEADS = num_heads
        FF_HIDDEN_SIZE = ff_hidden_size
        NUMBER_LAYERS = n
        DROPOUT = dropout
        ENC_INPUT = enc_input
        DEC_INPUT = dec_input
        DEC_SOURCE_MASK = dec_source_mask
        DEC_TARGET_MASK = dec_target_mask

        m = model.TFModel(ENCODER_IP_SIZE, DECODER_IP_SIZE, MODEL_OP_SIZE, EMB_SIZE, NUM_HEADS, FF_HIDDEN_SIZE, NUMBER_LAYERS, DROPOUT)

        print(exir.capture(m, (enc_input, dec_input, dec_source_mask, dec_target_mask)).to_edge())

        pre_autograd_aten_dialect = capture_pre_autograd_graph(m, (enc_input, dec_input, dec_source_mask, dec_target_mask))
        aten_dialect: ExportedProgram = export(pre_autograd_aten_dialect, (enc_input, dec_input, dec_source_mask, dec_target_mask))
        edge_program: exir.EdgeProgramManager = exir.to_edge(aten_dialect)
        executorch_program: exir.ExecutorchProgramManager = edge_program.to_executorch(
        ExecutorchBackendConfig(
        # passes=[],  # User-defined passes
        )
        )

        with open("/home/adonnini1/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master/models/tfmodel.pte", "wb") as file:
            file.write(executorch_program.buffer)

        edge_program = edge_program.to_backend(XnnpackPartitioner)
        exec_prog = edge_program.to_executorch()

        with open("/home/adonnini1/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master/models/tfmodel_exnnpack.pte", "wb") as file:
            file.write(exec_prog.buffer)

@larryliu0820
Copy link
Contributor

Can you add

m.eval()

after this line

m = model.TFModel(...)

@adonnini
Copy link
Author

adonnini commented Nov 28, 2023

@larryliu0820 I added the line as you asked. However, the code fails at this line

print(exir.capture(m, (enc_input, dec_input, dec_source_mask, dec_target_mask)).to_edge())

producing the error log below. I seem to remember I had to make a one-line change to an executorch module, I am not sure.

The last time I ran this code (Novembre 9) it worked without problems.

Traceback (most recent call last):
  File "/home/adonnini1/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master/train-minimum.py", line 324, in <module>
    print(exir.capture(m, (enc_input, dec_input, dec_source_mask, dec_target_mask)).to_edge())
  File "/home/adonnini1/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master/executorch/exir/program/_program.py", line 168, in to_edge
    return _to_edge(self, config)
  File "/home/adonnini1/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master/executorch/exir/program/_program.py", line 283, in _to_edge
    EXIRATenDialectVerifier()(ep.exported_program.graph_module)
  File "/home/adonnini1/anaconda3/lib/python3.9/site-packages/torch/_export/verifier.py", line 58, in __call__
    self.check_valid(gm)
  File "/home/adonnini1/anaconda3/lib/python3.9/site-packages/torch/_export/verifier.py", line 117, in check_valid
    self.check_valid_op(node.target)
  File "/home/adonnini1/anaconda3/lib/python3.9/site-packages/torch/_export/verifier.py", line 166, in check_valid_op
    raise SpecViolationError(
torch._export.verifier.SpecViolationError: Operator torch._ops.aten.detach.default is not Aten Canonical.
(base) adonnini1@actlnxlptp6:~/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master$ 

@kimishpatel
Copy link
Contributor

For inference optimization we should not really have dropout operator. @kirklandsign can you or someone write a pass to remove dropout?

Does this mean we don't need to add native_dropout to portable? By the way, that op is currently classified as a core op. Does this mean there are core ops that don't need to be added to the portable library?

Manuel, we probably should add the op, but for inference case I am contending we dont need it for this case

@adonnini
Copy link
Author

adonnini commented Nov 28, 2023

@larryliu0820
I made this change
#290 (comment)
Now the code seems to be running normally. It's going to take a while to go through 25 epochs.
I'll update you tomorrow

If execution completes normally. What should I do next? What was the reason for adding

m.eval()

?
Should try and load the model produced after adding m.eval() from my Android application and run it for inference?
Thanks

@larryliu0820
Copy link
Contributor

Yes please use the model after adding m.eval()

@larryliu0820
Copy link
Contributor

Closing this one since it's resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants