-
Notifications
You must be signed in to change notification settings - Fork 26
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: pass task-specific config to backend #922
Conversation
anhappdev
commented
Sep 24, 2024
- Closes make the number of steps of stable diffusion configuration #921
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
custom_config { | ||
id: "stable_diffusion_seed" | ||
value: "633994880" | ||
} | ||
custom_config { | ||
id: "stable_diffusion_num_steps" | ||
value: "20" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This how a custom setting for all backends can be defined in tasks.pbtxt
for (int i = 0; i < configs->count; ++i) { | ||
if (strcmp(configs->keys[i], "stable_diffusion_seed") == 0) { | ||
backend_data->seed = atoi(configs->values[i]); | ||
} | ||
if (strcmp(configs->keys[i], "stable_diffusion_num_steps") == 0) { | ||
backend_data->num_steps = atoi(configs->values[i]); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend can read them from mlperf_backend_configuration_t
in mlperf_backend_create
.
--lib_path="bazel-bin/mobile_back_tflite/cpp/backend_tflite/libtflitebackend.so" \ | ||
--custom_config="stable_diffusion_num_steps:20,stable_diffusion_seed:633994880" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the main.cc
file for development, one can pass it with the flag custom_config
Quality Gate passedIssues Measures |