MathOnco / valis

Virtual Alignment of pathoLogy Image Series
https://valis.readthedocs.io/en/latest/
MIT License
119 stars 29 forks source link

Where to choose the default GPU #128

Open syy-create opened 4 months ago

syy-create commented 4 months ago

Hi, @cdgatenbee I would like to know where to choose the GPU for the code, as the default GPU does not guarantee constant availability. Therefore, I am considering trying another option when the default GPU is busy, but I have not found any relevant code. I hope you can help me with this. Thank you very much.

cdgatenbee commented 4 months ago

Hi @syy-create, Unfortunately, most of valis is currently limited to the cpu. The current exceptions are SuperPoint and SuperGlue feature detectors and matchers, which use pytorch (feature_detectors.SuperPointFD, feature_matcher.SuperGlueMatcher, feature_matcher.SuperPointAndGlue). In the case of the Matchers, you can set force_cpu=True when you initialize the Matcher object to avoid using the GPU. However, in the case of feature_detectors.SuperPointFD, I need to add the option to pass in keyword arguments when using the feature_detectors in the Valis object. I'm putting the final touches on the next update, but this should be straightforward, so I'll be sure include it in the next update.

Best, -Chandler

syy-create commented 4 months ago

thanks @cdgatenbee , I understand what you mean now. Currently, most programs only use CPUs. But I still have a question that I hope you can help answer, which is what conditions the performance of this CPU needs to meet in order to meet the needs of the program. Because when I am using high-precision registration with a larger wsi (approximately two GB per image), the program inexplicably crashes (the terminal will be closed), so I have to lower the micro_reg_fraction parameter to 0.03. However, this accuracy is too poor and may not be as good as before. I speculate that my computer's CPU performance is too poor, so I want to know what configuration I need to use High resolution registration normally with the micro_reg_fraction parameter set to 0.25.