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 new benchmark Stable Diffusion #903

Merged
merged 45 commits into from
Sep 6, 2024

Conversation

anhappdev
Copy link
Collaborator

@anhappdev anhappdev commented Aug 14, 2024

Copy link

github-actions bot commented Aug 14, 2024

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

@anhappdev
Copy link
Collaborator Author

@RSMNYS You should be able to integrate the Stable Diffusion pipeline for mobile_back_tflite based on this branch.
I will implement the download of multiple models in a separated PR. But for now, you should be able to just use a local folder path instead of a file path, (more here) e.g.:

model_path: "local:///path/to/folder"

then the model_path will be a folder path in:

mlperf_backend_ptr_t mlperf_backend_create(const char* model_path, mlperf_backend_configuration_t* configs, const char* native_lib_path)

@freedomtan
Copy link
Contributor

@freedomtan to check this implementation

@RSMNYS
Copy link
Contributor

RSMNYS commented Aug 20, 2024

@RSMNYS You should be able to integrate the Stable Diffusion pipeline for mobile_back_tflite based on this branch. I will implement the download of multiple models in a separated PR. But for now, you should be able to just use a local folder path instead of a file path, (more here) e.g.:

model_path: "local:///path/to/folder"

then the model_path will be a folder path in:

mlperf_backend_ptr_t mlperf_backend_create(const char* model_path, mlperf_backend_configuration_t* configs, const char* native_lib_path)

Hi guys! I've pushed the code partially here:

https://github.com/mlcommons/mobile_app_open/tree/features/pipeline_backend

The idea was to create the pipeline (stable_diffusion_backend.cc). And initiate it from the dart-run-benchmark.cc, by checking the dataset type for example. Then in issueQuery we can process the stable diffusion steps.

@anhappdev @freedomtan

@anhappdev
Copy link
Collaborator Author

anhappdev commented Aug 21, 2024

@RSMNYS I refactored the TFLite backend to support multiple pipelines.
You can add your implementation to mobile_back_tflite/cpp/backend_tflite/stable_diffusion_pipeline.cc.
Please remember to update init_pipeline() in tflite_c.cc.

RSMNYS and others added 19 commits August 30, 2024 18:04
* feat: added stable diffusion pipeline (WIP)

* - enabled stable diffusion pipeline
- code formatting

* style: code formatting

* style: code formatting

* fix: adjusted inputs and outputs for the stable_diffusion_pipeline

* fix: adjusted sd flow

* fix: added unconditional tokens generation

* chore: adjustments
* Suggestions for few changes in coco_gen dataset

* Fixing a path
* Dump output of SD model to file

* Add Python script to convert RGB8 to PNG

* Dump raw output only in accuracy mode
error C2039: '__fs': is not a member of 'std'
error: 'path' is unavailable: introduced in iOS 13.0
error: 'path' is unavailable: introduced in iOS 13.0
Copy link

sonarqubecloud bot commented Sep 6, 2024

@anhappdev
Copy link
Collaborator Author

We can merge this PR into master now. I disabled the tests for stable_diffusion task, so we have it passed the CI when merging into master and will enable it again in the submission branch.

@anhappdev anhappdev marked this pull request as ready for review September 6, 2024 02:42
@anhappdev anhappdev requested a review from a team as a code owner September 6, 2024 02:42
@anhappdev anhappdev requested a review from freedomtan September 6, 2024 02:42
Copy link
Contributor

@freedomtan freedomtan left a comment

Choose a reason for hiding this comment

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

LGTM. @mohitmundhragithub if you are OK with this. Let's merge it.

@anhappdev anhappdev merged commit 66608c8 into master Sep 6, 2024
22 checks passed
@anhappdev anhappdev deleted the anh/add-benchmark-stable-diffusion branch September 6, 2024 09:55
@github-actions github-actions bot locked and limited conversation to collaborators Sep 6, 2024
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