Skip to content
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

feat: add result upload #703

Merged
merged 22 commits into from
Jul 7, 2023
Merged

feat: add result upload #703

merged 22 commits into from
Jul 7, 2023

Conversation

anhappdev
Copy link
Collaborator

@anhappdev anhappdev commented May 3, 2023

Part of #670

User can upload benchmark result to MLCommons cloud storage via the app.
The Share button now has 2 options:

  • Share with others: Share via phone file sharing feature.
  • Share with MLCommons: Upload result file to MLCommons cloud storage.

@github-actions
Copy link

github-actions bot commented May 3, 2023

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

anhappdev added 6 commits May 3, 2023 20:14
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
@@ -43,7 +43,7 @@ android {

defaultConfig {
applicationId "org.mlcommons.android.mlperfbench"
minSdkVersion 16
minSdkVersion 21
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to increase the minSdkVersion to 21 to fix a build error described here https://developer.android.com/build/multidex

Per this screenshot (from Android Studio) this should not affect much the number of Android phones which can run this app.

Screenshot 2023-05-03 at 22 40 25

@anhappdev anhappdev marked this pull request as ready for review May 4, 2023 01:33
@freedomtan
Copy link
Contributor

@anhappdev suggested we have to as Nathan to give read access to other guys who want to test this (let one who wants to test this be a user of that firebase project).

@anhappdev anhappdev requested a review from a team as a code owner May 24, 2023 10:54
@anhappdev
Copy link
Collaborator Author

@freedomtan @AhmedTElthakeb @mohitmundhragithub
Please use this APK to test the upload. You should already have access to the Firebase Storage.
2023-05-24_mlperfbench-ec030a7-t.apk

@freedomtan
Copy link
Contributor

@freedomtan @AhmedTElthakeb @mohitmundhragithub Please use this APK to test the upload. You should already have access to the Firebase Storage. 2023-05-24_mlperfbench-ec030a7-t.apk

Yes, I can see "mobile-app-build" project in the Firebase Console.

  • I can see data I uploaded in "Storage"
  • I cannot see them in "Firebase Database". I assume this is right for now.

@anhappdev
Copy link
Collaborator Author

  • I cannot see them in "Firebase Database". I assume this is right for now.

Yes. It's correct. The app uploads the result as a JSON file to Storage. We don't use "Firebase Database".

@freedomtan
Copy link
Contributor

freedomtan commented Jun 6, 2023

@anhappdev please add uploading feature to all the backends by building an apk with all the backends

@freedomtan
Copy link
Contributor

@anhappdev as @AhmedTElthakeb reported, the app crashed for each task. The attached log was captured when running the mobilenet edgetpu. It crashed because of null pointer

06-20 15:34:08.106 20345 20345 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-20 15:34:08.106 20345 20345 F DEBUG   : Build fingerprint: 'samsung/g0sxeea/g0s:13/TP1A.220624.014/S906BXXU5CWEA:user/release-keys'
06-20 15:34:08.106 20345 20345 F DEBUG   : Revision: '28'
06-20 15:34:08.106 20345 20345 F DEBUG   : ABI: 'arm64'
06-20 15:34:08.106 20345 20345 F DEBUG   : Processor: '5'
06-20 15:34:08.106 20345 20345 F DEBUG   : Timestamp: 2023-06-20 15:34:07.900482968+0800
06-20 15:34:08.106 20345 20345 F DEBUG   : Process uptime: 23s
06-20 15:34:08.106 20345 20345 F DEBUG   : Cmdline: org.mlcommons.android.mlperfbench
06-20 15:34:08.106 20345 20345 F DEBUG   : pid: 20177, tid: 20297, name: DartWorker  >>> org.mlcommons.android.mlperfbench <<<
06-20 15:34:08.106 20345 20345 F DEBUG   : uid: 10382
06-20 15:34:08.106 20345 20345 F DEBUG   : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
06-20 15:34:08.106 20345 20345 F DEBUG   : pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
06-20 15:34:08.106 20345 20345 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000040
06-20 15:34:08.106 20345 20345 F DEBUG   : Cause: null pointer dereference
06-20 15:34:08.106 20345 20345 F DEBUG   :     x0  000000798682777c  x1  0000000000000000  x2  0000000000000001  x3  000000000000005b
06-20 15:34:08.106 20345 20345 F DEBUG   :     x4  0000000000000021  x5  0000000000027eda  x6  636e6c5e67626073  x7  7f7f7f7f7f7f7f7f
06-20 15:34:08.106 20345 20345 F DEBUG   :     x8  0000000000000000  x9  346f474788b54376  x10 00000000000003e8  x11 346f474788b54376
06-20 15:34:08.106 20345 20345 F DEBUG   :     x12 0000007986c00fe0  x13 0000000000000052  x14 0000000000000000  x15 0000000215f208ce
06-20 15:34:08.106 20345 20345 F DEBUG   :     x16 0000007cb2d6a430  x17 0000007cb2d47f60  x18 0000007985ef6000  x19 b400007b05194090
06-20 15:34:08.106 20345 20345 F DEBUG   :     x20 0000007986c03a68  x21 0000007986c03a70  x22 0000007986c03940  x23 0000007986c03a70
06-20 15:34:08.106 20345 20345 F DEBUG   :     x24 b400007b05194210  x25 0000007986c03970  x26 b400007a351993d0  x27 00000000000000b0
06-20 15:34:08.106 20345 20345 F DEBUG   :     x28 0000007986c06000  x29 0000007986c03930
06-20 15:34:08.106 20345 20345 F DEBUG   :     lr  0000007904319adc  sp  0000007986c02890  pc  0000007986827784  pst 0000000060001000
06-20 15:34:08.106 20345 20345 F DEBUG   : backtrace:
06-20 15:34:08.106 20345 20345 F DEBUG   :       #00 pc 0000000000011784  /data/app/~~ecO03F6aRzgmubX9396QEA==/org.mlcommons.android.mlperfbench-9UL9TVeXWv52p95Wkotvcw==/lib/arm64/libmbe2200_core.so (backend_get_input_count+8) (BuildId: ea7836a581c6d255620c5edf16b00c1736169338)
...
...

log:
foobar.txt

@anhappdev
Copy link
Collaborator Author

@anhappdev as @AhmedTElthakeb reported, the app crashed for each task. The attached log was captured when running the mobilenet edgetpu. It crashed because of null pointer

It looks like the error is somewhere in the mobile_back_samsung code. @AhmedTElthakeb Can you please check if the checksum of libmbe2200_core.so is up-to-date?

Anyway, I don't think the error is related to this pull request, maybe it's already there for some time. We may need to fix it in another pull request.
@freedomtan @AhmedTElthakeb Can you please test this APK if we still have that crash?
https://github.com/mlcommons/mobile_app_open/actions/runs/5319375937?pr=735

@anhappdev anhappdev marked this pull request as ready for review June 20, 2023 08:56
@AhmedTElthakeb
Copy link
Contributor

AhmedTElthakeb commented Jun 21, 2023

Anyway, I don't think the error is related to this pull request, maybe it's already there for some time. We may need to fix it in another pull request. @freedomtan @AhmedTElthakeb Can you please test this APK if we still have that crash? https://github.com/mlcommons/mobile_app_open/actions/runs/5319375937?pr=735

@anhappdev
Yes this one crashes same way.

It could be due to some incompatible recent commits to the master branch we have not accounted for yet. We are preparing a pull request to catch up with master.

In the meantime, is it possible to try this "add result upload" feature on top of v3.0 branch instead of master?

@anhappdev
Copy link
Collaborator Author

@anhappdev Yes this one crashes same way.

It could be due to some incompatible recent commits to the master branch we have not accounted for yet. We are preparing a pull request to catch up with master.

In the meantime, is it possible to try this "add result upload" feature on top of v3.0 branch instead of master?

The v3.0 branch now differs greatly from the master branch, so it would require significant effort to make this PR work on the v3.0 branch.

Is it critical to test this PR with the Samsung backend? I mean that the upload feature works independently of any backends.

@mohitmundhragithub
Copy link
Contributor

Here is a new APK with all backends: 2023-06-06_mlperfbench-2e482f8-qsmgt.apk

this app shows just white screen on qualcomm device.

@anhappdev as @AhmedTElthakeb reported, the app crashed for each task. The attached log was captured when running the mobilenet edgetpu. It crashed because of null pointer

It looks like the error is somewhere in the mobile_back_samsung code. @AhmedTElthakeb Can you please check if the checksum of libmbe2200_core.so is up-to-date?

Anyway, I don't think the error is related to this pull request, maybe it's already there for some time. We may need to fix it in another pull request. @freedomtan @AhmedTElthakeb Can you please test this APK if we still have that crash? https://github.com/mlcommons/mobile_app_open/actions/runs/5319375937?pr=735

this app doesn't show option to share results to mlcommon's firebase.

@mohitmundhragithub
Copy link
Contributor

Here is a new APK with all backends: 2023-06-06_mlperfbench-2e482f8-qsmgt.apk

I tested this APK on couple devices, and the app crashes on both devices.

06-24 18:58:38.963 2787 3363 D CoreBackPreview: Window{8dd7795 u0 Splash Screen org.mlcommons.android.mlperfbench EXITING}: Setting back callback null
06-24 18:58:38.963 2787 3365 W InputManager-JNI: Input channel object '8dd7795 Splash Screen org.mlcommons.android.mlperfbench (client)' was disposed without first being removed with the input manager!

I see these errors in logcat logs.

@anhappdev
Copy link
Collaborator Author

anhappdev commented Jun 26, 2023

this app doesn't show option to share results to mlcommon's firebase.

Yes, because it's based on the master branch, to test if the error with Samsung backend was introduced with this PR or it's already in the master for some time.

this app shows just white screen on qualcomm device.

That is interesting. I just merged the master branch into this PR to have the CI automatically build the APK. Can you test again with this new build and then upload a full log (as .txt file) here for debugging?
The CI build can be downloaded by clicking on "Details" of App Build / build-android-apk (pull_request) then "Summary".

@freedomtan
Copy link
Contributor

Here is a new APK with all backends: 2023-06-06_mlperfbench-2e482f8-qsmgt.apk

this app shows just white screen on qualcomm device.

@anhappdev as @AhmedTElthakeb reported, the app crashed for each task. The attached log was captured when running the mobilenet edgetpu. It crashed because of null pointer

It looks like the error is somewhere in the mobile_back_samsung code. @AhmedTElthakeb Can you please check if the checksum of libmbe2200_core.so is up-to-date?
Anyway, I don't think the error is related to this pull request, maybe it's already there for some time. We may need to fix it in another pull request. @freedomtan @AhmedTElthakeb Can you please test this APK if we still have that crash? https://github.com/mlcommons/mobile_app_open/actions/runs/5319375937?pr=735

this app doesn't show option to share results to mlcommon's firebase.

FYR. This 2023-06-06_mlperfbench-2e482f8-qsmgt.apk works for a colleague's Xiaomi 13 Pro (a 8 Gen 2 device). Uploading also works.

@mohitmundhragithub
Copy link
Contributor

mohitmundhragithub commented Jun 27, 2023

this app doesn't show option to share results to mlcommon's firebase.

Yes, because it's based on the master branch, to test if the error with Samsung backend was introduced with this PR or it's already in the master for some time.

this app shows just white screen on qualcomm device.

That is interesting. I just merged the master branch into this PR to have the CI automatically build the APK. Can you test again with this new build and then upload a full log (as .txt file) here for debugging? The CI build can be downloaded by clicking on "Details" of App Build / build-android-apk (pull_request) then "Summary".

thanks. this apk works. But unable to upload. Basically, nothing happens on clicking "share with mlcommons"

image

@anhappdev
Copy link
Collaborator Author

thanks. this apk works. But unable to upload. Basically, nothing happens on clicking "share with mlcommons"

I fixed this recently so you will need the APK with build number > 49.

@anhappdev
Copy link
Collaborator Author

@mohitmundhragithub Did you have a chance to test again with a newer build?

@mohitmundhragithub
Copy link
Contributor

mohitmundhragithub commented Jul 3, 2023

@mohitmundhragithub Did you have a chance to test again with a newer build?

I tried with build "android-apks-50" again. But seeing white screen with this.

07-01 17:58:44.532 2787 10195 D CoreBackPreview: Window{4085017 u0 Splash Screen org.mlcommons.android.mlperfbench EXITING}: Setting back callback null
07-01 17:58:44.532 2787 12730 W InputManager-JNI: Input channel object '4085017 Splash Screen org.mlcommons.android.mlperfbench (client)' was disposed without first being removed with the input manager!

This seems to be the culprit log.

@mohitmundhragithub
Copy link
Contributor

mohitmundhragithub commented Jul 3, 2023

Update: after waiting for sometime, I see this error:

image

Wanted to check, is firebase not available from china machines?

@anhappdev
Copy link
Collaborator Author

It looks like a connection issue. A quick Google search shows indeed that Firebase does not work in China.

@mohitmundhragithub
Copy link
Contributor

mohitmundhragithub commented Jul 3, 2023

It looks like a connection issue. A quick Google search shows indeed that Firebase does not work in China.

actually i tried with a device in india as well, but it didn't work :(
Will try with some more devices and update

@anhappdev
Copy link
Collaborator Author

actually i tried with a device in india as well, but it didn't work :(

Is the device behind a proxy or has limited internet connection?

@mohitmundhragithub
Copy link
Contributor

mohitmundhragithub commented Jul 3, 2023

actually i tried with a device in india as well, but it didn't work :(

Is the device behind a proxy or has limited internet connection?

Its connected to office wifi open for all personal devices... so no proxy.
I will check in my home network on some other device later in the day and update.

@anhappdev
Copy link
Collaborator Author

Its connected to office wifi open for all personal devices... so no proxy. I will check in my home network on some other device later in the day and update.

@mohitmundhragithub Any update on this?

@mohitmundhragithub
Copy link
Contributor

I just tried out on a personal device, and it's working fine.
I am able to see the results on firebasestorage as well.

Just one comment that having the results to be sorted or having some meaningful name for the folders may help in searching the results on the portal.

@anhappdev
Copy link
Collaborator Author

Just one comment that having the results to be sorted or having some meaningful name for the folders may help in searching the results on the portal.

Thank you for your feedback, but the Firebase website is not meant to be used as a frontend. Searching or viewing the results will be done in the app.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@anhappdev anhappdev merged commit cd2af4b into master Jul 7, 2023
@anhappdev anhappdev deleted the 670/add-result-upload branch July 7, 2023 06:35
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants