Skip to content

refactor: move all cache parameter defaults to the library#1327

Open
wbruna wants to merge 1 commit intoleejet:masterfrom
wbruna:sd_cache_defaults_init
Open

refactor: move all cache parameter defaults to the library#1327
wbruna wants to merge 1 commit intoleejet:masterfrom
wbruna:sd_cache_defaults_init

Conversation

@wbruna
Copy link
Contributor

@wbruna wbruna commented Mar 6, 2026

Simplifies cache initialization for library users.

Simplifies cache initialization for library users.
@wbruna
Copy link
Contributor Author

wbruna commented Mar 6, 2026

@rmatif and @leejet , the --cache-preset handling from 186038e apparently got discarded before #1066 got merged as 298b110 . The option is validated and written to the cache_preset field, but the value isn't used anywhere.

Fixing it isn't straightforward because the needed functions (get_scm_preset, get_preset_threshold, etc) on cache-dit.hpp are not part of the library API. So my idea is, on top of this PR here:

  • add a new field for the preset to the sd_cache_params_t struct
  • initialize the four relevant fields to specific invalid values to distinguish them from values explicitly set through --cache-options (I believe negatives would work);
  • during inference, replace the negatives (and an empty scm array) with the appropriate values according to the preset.

But... since this bug went off the radar for over two months, I'm wondering if it's really worth the effort, or if we should just remove the flag instead. What do you think?

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.

1 participant