mittagessen / kraken

OCR engine for all the languages
http://kraken.re
Apache License 2.0
673 stars 125 forks source link

set `torch.set_float32_matmul_precision('medium' | 'high')` #596

Closed johnlockejrr closed 1 month ago

johnlockejrr commented 2 months ago

You are using a CUDA device ('NVIDIA GeForce RTX 4070') that has Tensor Cores. To properly utilize them, you should set torch.set_float32_matmul_precision('medium' | 'high')

Should this warning be ignored or there's an option to enable that option?

Using bf16 precision in ketos would enable this option (bf16 = bfloat16 ?)?

mittagessen commented 2 months ago

On 24/04/25 11:42PM, johnlockejrr wrote:

You are using a CUDA device ('NVIDIA GeForce RTX 4070') that has Tensor Cores. To properly utilize them, you should set torch.set_float32_matmul_precision('medium' | 'high')

Should this warning be ignored or there's an option to enable that option?

You can ignore this warning. With our current models it doesn't change much and with the next generation recognizer where it causes a noticeable speedup in the medium precision mode it seems to be slightly detrimental to accuracy.

johnlockejrr commented 2 months ago

Perfect! I opt for accuracy instead speedup.