Skip to content

Commit

Permalink
fix: Minimize gpu memory fragmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hh-space-invader committed Feb 28, 2025
1 parent 2082108 commit ed5bc00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastembed/common/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _load_onnx_model(

so = ort.SessionOptions()
so.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL

so.add_session_config_entry("memory.enable_memory_arena_shrinkage", "1")
if threads is not None:
so.intra_op_num_threads = threads
so.inter_op_num_threads = threads
Expand Down

0 comments on commit ed5bc00

Please sign in to comment.