petals icon indicating copy to clipboard operation
petals copied to clipboard

Add flag to only use already cached blocks

Open scuty2000 opened this issue 2 years ago • 5 comments

Allow users to specify the caching dir for the model's blocks

BONUS: add flag to only use already cached blocks, excluding those which are not already on the server

scuty2000 avatar Jan 11 '23 17:01 scuty2000

Hi @scuty2000!

The server already has a flag for the cache dir, its name is --cache_dir.

Regarding the flag to only use already cached blocks, could you please clarify why it would be useful to you? Please note that:

  • If your concern is the free disk space, the server is already able to recycle the disk space it uses for cache (= remove older blocks to free space for new ones). It may uses all free space minus 1 GiB by default, but you can set a stricter limit for the cache using the --max_disk_space argument.

  • If you'd like a server to only a certain fixed range of blocks, you can define it with --block_indices.

  • If your concern is the amount of network traffic or the speed of loading blocks, please let me know, I agree that such a flag would be useful in these cases.

borzunov avatar Jan 11 '23 19:01 borzunov

Hi, I didn't see the --cache-dir arg, sorry for that.

For the second part, I meant exacly what you said in the third point, regarding network traffic and the speed of block loading.

scuty2000 avatar Jan 12 '23 08:01 scuty2000

Apologies: I won't work on this now, as --block_indices and/or --max_disk_space are a viable workaround, and I feel there's more impactful work (in this and other projects) to focus on right now.

tijszwinkels avatar Jan 19 '23 12:01 tijszwinkels

@tijszwinkels No worries, thanks for taking the time to help anyway!

borzunov avatar Jan 19 '23 16:01 borzunov

I second this, I need to occasionally restart the server and it is a bit frustrating that the algorithm picked just random other, not yet cached range. I don't want to limit to specific range.

Limiting of the block space could work though. I understand there're another important tasks to work on.

slush0 avatar Jan 24 '23 09:01 slush0