Skip to content

Conversation

@makn87amd
Copy link

  • Add sdcpp_backend option with --sdcpp CLI flag and LEMONADE_SDCPP env var
  • Support 'cpu' (default) and 'rocm' backends for sd.cpp
  • Download ROCm-enabled sd.cpp binaries for AMD GPU acceleration
  • Add backend-specific versioning in backend_versions.json
  • Set PATH for ROCm DLLs on Windows for HIP runtime loading
  • Add api_image_gen_rocm.py example demonstrating ROCm image generation
  • Fix example script to use correct API parameters (model_name, model)

- Add sdcpp_backend option with --sdcpp CLI flag and LEMONADE_SDCPP env var
- Support 'cpu' (default) and 'rocm' backends for sd.cpp
- Download ROCm-enabled sd.cpp binaries for AMD GPU acceleration
- Add backend-specific versioning in backend_versions.json
- Set PATH for ROCm DLLs on Windows for HIP runtime loading
- Add api_image_gen_rocm.py example demonstrating ROCm image generation
- Fix example script to use correct API parameters (model_name, model)
@makn87amd
Copy link
Author

The example needs to be pruned. It was auto-generated and has a ton of helper functions

{"ctx_size", 4096},
{"llamacpp_backend", "vulkan"},
{"llamacpp_args", ""},
{"sdcpp_backend", "cpu"}, // ADDED: sd.cpp backend selection (cpu or rocm)
Copy link
Collaborator

Choose a reason for hiding this comment

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

pretty noisy/pointless comment, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for taking a look @superm1, but the PR is still in draft state. I would expect @makn87amd to clean up on his own prior to marking Ready for Review.

{"envname", "LEMONADE_LLAMACPP_ARGS"},
{"help", "Custom arguments to pass to llama-server (must not conflict with managed args)"}
}},
// ADDED: sd.cpp backend selection option
Copy link
Collaborator

Choose a reason for hiding this comment

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

pretty noisy/pointless comment, no?

return {"ctx_size"};
} else if (recipe == "sd-cpp") {
return {"steps", "cfg_scale", "width", "height"};
// ADDED: Include sdcpp_backend for backend selection (cpu vs rocm)
Copy link
Collaborator

Choose a reason for hiding this comment

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

pretty noisy/pointless comment, no?

} else if (model_info.recipe == "sd-cpp") {
std::cout << "[Router] Creating SDServer backend" << std::endl;
new_server = std::make_unique<backends::SDServer>(log_level_, model_manager_);
// ADDED: Pass sdcpp_backend from default_options_ to SDServer
Copy link
Collaborator

Choose a reason for hiding this comment

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

pretty noisy/pointless comment, no?

{"option_name", "sdcpp_backend"},
{"type_name", "BACKEND"},
{"allowed_values", {"cpu", "rocm"}},
{"envname", "LEMONADE_SDCPP"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

please also add this new environment variable to data/lemonade.conf

Comment on lines +200 to +201
// macOS ARM build
filename = "sd-" + short_version + "-bin-Darwin-macOS-15.7.2-arm64.zip";
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this actually going to be published initially? I feel like this should be in the #else block

// Helper to get the install directory for sd executable
static std::string get_sd_install_dir() {
return (fs::path(get_downloaded_bin_dir()) / "sd-cpp").string();
// ADDED: Include backend subdirectory to support multiple backends
Copy link
Collaborator

Choose a reason for hiding this comment

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

noisy comment


// Helper to get stable-diffusion.cpp version from configuration
static std::string get_sd_version() {
// ADDED: Support for backend-specific versions (cpu vs rocm)
Copy link
Collaborator

Choose a reason for hiding this comment

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

noisy comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants