Not hardcode llama2 model in perf test#4657
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4657
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d08a5eb with merge base a70d070 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@guangy10 https://github.com/pytorch/executorch/actions/runs/10332366636/job/28606203444 instrument log, i.e. https://gha-artifacts.s3.amazonaws.com/device_farm/10332366636/2/arn_aws_devicefarm_us-west-2_308535385114_artifact_02a2cf0f-6d9b-45ee-ba1a-a086587469e6_8e51b233-2a4c-4380-85f5-7ad1c948805b_00002_00001_00000_00001_Customer_Artifacts.zip now highlight the error with @kirklandsign would probably know what this error means. |
| # Prepare the model and the tokenizer | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "ls -la /sdcard/" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "mkdir -p /data/local/tmp/llama/" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/tokenizer.bin /data/local/tmp/llama/tokenizer.bin" |
There was a problem hiding this comment.
Oh I just notice that this file is actually has a local copy stored in the demo-apps dir! Curious to know how it is uploaded to s3 so that the link https://ossci-assets.s3.amazonaws.com/android-llama2-device-farm-test-spec-v2.yml could work?
There was a problem hiding this comment.
Oh, the upload is still done manually, I plan to write a workflow to automatically upload it to S3 in the next PR, so that we can just update this file
| # The test spec can be downloaded from https://ossci-assets.s3.amazonaws.com/android-llama2-device-farm-test-spec.yml | ||
| test-spec: arn:aws:devicefarm:us-west-2:308535385114:upload:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/abd86868-fa63-467e-a5c7-218194665a77 | ||
| # The test spec can be downloaded from https://ossci-assets.s3.amazonaws.com/android-llama2-device-farm-test-spec-v2.yml | ||
| test-spec: https://ossci-assets.s3.amazonaws.com/android-llama2-device-farm-test-spec-v2.yml |
There was a problem hiding this comment.
Can we rename it to something more generic, i.e. android-llm-device-farm-test-spec-v2.yml?
| - adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/*.pt /data/local/tmp/llama/" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "chmod 664 /data/local/tmp/llama/*.bin" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "chmod 664 /data/local/tmp/llama/*.pte" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "chmod 664 /data/local/tmp/llama/*.pt" |
There was a problem hiding this comment.
We probably won't need this line.
There was a problem hiding this comment.
Is there a bug here in .ci/scripts/test_llama.sh script? I only see 2 files stories110M.pt and the tokenizer, i.e. https://gha-artifacts.s3.amazonaws.com/pytorch/executorch/10332366636/artifact/stories110M_xnnpack/model.zip? That's why I attempt to add the *.pt file here
| int loadResult = mModule.load(); | ||
| // Check that the model can be load successfully | ||
| assertEquals(0, loadResult); |
| // Find out the model name | ||
| File directory = new File(RESOURCE_PATH); | ||
| Arrays.stream(directory.listFiles()) | ||
| .filter(file -> file.getName().endsWith(".pte") || file.getName().endsWith(".pt")) |
There was a problem hiding this comment.
We don't need .pt file, it's the suffix of the weights for stories110M
There was a problem hiding this comment.
I see, let me remove this, but it looks like something is not right where the https://gha-artifacts.s3.amazonaws.com/pytorch/executorch/10332366636/artifact/stories110M_xnnpack/model.zip contains only stories110M.pt and the tokenizer. Should there be an exported stories110M.pte model there? Maybe this explain why it fails to load.
There was a problem hiding this comment.
So you merge the test spec fix and ignore the "failed to load model" issue
There was a problem hiding this comment.
yeah, the fix is in #4642
Oh, got it, let me push a commit to fix the other comments and land this PR
guangy10
left a comment
There was a problem hiding this comment.
Thanks for the fix. Make sure the comments are addressed before merging
|
LGTM. @kirklandsign may want to review the app as he is working on integrating a new activity. |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| - adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/*.bin /data/local/tmp/llama/" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "mv /sdcard/*.pte /data/local/tmp/llama/" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "chmod 664 /data/local/tmp/llama/*.bin" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "chmod 664 /data/local/tmp/llama/*.pte" | ||
| - adb -s $DEVICEFARM_DEVICE_UDID shell "ls -la /data/local/tmp/llama/" |
There was a problem hiding this comment.
Replace "llama" with "llm" for those paths as well.
There was a problem hiding this comment.
Oh, I remember this path /data/local/tmp/llama/ was hard-coded in the app before. If that's not the case anymore, I could update it, maybe after #4676 lands to avoid the need to upload the spec manually
This fixes the hack in #4642. While I wanted to do the fix directly in #4642, it becomes more complicated because the hardcoded path is also used in the instrumented test case. So, I spin this out into a different PR.
This PR also fixes the way the test reports the TPS metric by calling sendStatus to correctly populate instrument log. For example,
Testing
https://github.com/pytorch/executorch/actions/runs/10332366636