Explorar el Código

perf(inference): adjust batch ratio for GPU memory sizes

- Remove separate condition for GPU memory >= 24GB
- Simplify logic to use a single threshold of 16GB
myhloli hace 8 meses
padre
commit
2f40fa7d3c
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      magic_pdf/model/doc_analyze_by_custom_model.py

+ 1 - 3
magic_pdf/model/doc_analyze_by_custom_model.py

@@ -257,9 +257,7 @@ def may_batch_image_analyze(
     if str(device).startswith('npu') or str(device).startswith('cuda'):
         gpu_memory = int(os.getenv('VIRTUAL_VRAM_SIZE', round(get_vram(device))))
         if gpu_memory is not None:
-            if gpu_memory >= 24:
-                batch_ratio = 32
-            elif gpu_memory >= 16:
+            if gpu_memory >= 16:
                 batch_ratio = 16
             elif gpu_memory >= 12:
                 batch_ratio = 8