use time step embedding from file#928
Conversation
* Add TaskConfig.CustomConfig and pass them to backend * Add CustomConfig for main.cc * Use seed and num_steps from CustomConfig for TFLite backend * Replace std::cout with LOG(INFO) * Format files
* Add ConvertOutputs() API * Add ConvertOutputs() for mobile_back_tflite * Set minimum macos version * Set minimum macos version to 13.1 * Update _kIphoneOnGitHubAction
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
|
|
@mohitmundhragithub to share the code used to generate this embedding. |
|
@RSMNYS, The function where the time step embedding is generated is shared here: https://github.com/mlcommons/submissions_mobile_v4.1/issues/6#issuecomment-2399205941
|
@mohitmundhragithub Shown code is only for the embedding generation. And no operations from the cut part are shown. (fully connected layer, Logistic/Sigmoid activation, and mul operation. |
|
@anhappdev to share the QPM Stable Diffusion Jupyter notebook with @RSMNYS |
Increase minSdkVersion to 30
|
@AhmedTElthakeb to provide a small tflite with only 3 operations. @mohitmundhragithub will try to compare tflite and onnx files. |
|
|
Hi guys! So I've used the model prepared by Ahmed to generate the embedding file. Now all works good. Here the link to the colab: https://colab.research.google.com/drive/1LG_rC5dlx2CbW2ZF4EamOnCdwtwLQESv?usp=sharing to prepare the embedding file, and the link to the models and embedding file: https://drive.google.com/drive/folders/1CT6VUWwGaTw34Za6dTJE7ptms20NUKH3?usp=sharing |
* master: chore: increase Android minSdkVersion from 21 to 30 (#859) fix: resolve crash due to permission denied on Android Play Store version (#930) refactor: use custom setting in Core ML backend to detect NCHW input. (#924) # Conflicts: # mobile_back_tflite/cpp/backend_tflite/stable_diffusion_pipeline.cc
|
please use pickle for saving the embedding. @mohitmundhragithub please help figure out the difference between the one generated by @RSMNYS and Q's. |
|
once the pickle is done, please make the embedding part of the files to be downloaded for Stable Diffusion for the TFLite backend. |
here you can find 2 files in json format to be able to compare numbers at least: https://drive.google.com/drive/folders/1SO1akyvWd2uYz9Xf_u5OGBJLetuW6x5A?usp=sharing |
|
guys, I've updated the colab to generate the pkl file. Also adjusted embedding_utils code to parse this. Here you can find the pkl file: https://drive.google.com/file/d/1pDd5wZje1KbIS4JcWzhDx00aN8GmTBpc/view?usp=share_link |
@anhappdev I think for this we only need to upload the new UNET model (without embedding operations), and our embedding file. Right? If yes, can you please help upload those 2 files to the storage, from where we download models and other assets: https://drive.google.com/file/d/1pDd5wZje1KbIS4JcWzhDx00aN8GmTBpc/view?usp=share_link |
@RSMNYS Here is the URL for the 2 files you shared And other model files for reference: |
that works good! |
* submission-v4.1: feat: add icon and description for Stable Diffusion benchmark (#917) enable stable diffusion in Pixel backend (#936) Update tflite_settings_mtk_mt6989.pbtxt Update QTI backend for submission v4.1 (#13) Applying linter changes Ran make format Update seed and num_steps for TFLite SD task (#16) Addressing review comments Final Submission for code for Qualcomm Add a caption_id to coco_gen dataset (#918) Enable stable_diffusion tests # Conflicts: # flutter/cpp/datasets/coco_gen.cc # mobile_back_apple/dev-utils/Makefile # mobile_back_tflite/cpp/backend_tflite/backend_settings/tflite_settings_android.pbtxt # mobile_back_tflite/cpp/backend_tflite/stable_diffusion_pipeline.h
|
Hi guys! I can run stable diffusion on my android device (Samsung Galaxy S22), but at the end I have 0 as a result, however I see all the steps in logs. Checking why. Also, during the stable diffusion process we are not updating the progress, so it's hard to understand what is going on. |
can you share the loadgen and logcat logs? |
|
Let's
|
|
Benchmark result.json |
|
|
I tested this PR. Here is the output images of the TFLite backend: Many images look "wrong" with the color like this one, please check them out. Noted that the output images are only saved to disk when we run the accuracy test. |
almost all the images have such artifacts. |
Most likely, it's caused by quantization. At least, we know timesteps embedding works as expected. |
|
Let's merge this and create a 5.0 submission branch, then work on using fp16 models. @AhmedTElthakeb please check if you can export fp16 tflite models (https://ai.google.dev/edge/litert/models/post_training_float16_quant). |
|
By 5.1, qualcomm backend will use the timestep binary file (so that we have a shared timestep source file). @mohitmundhragithub |
|
Here is the fp16 versions release: alpha-tflite-v0.4 |








Timestamp-embedding-parser