File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ const STORAGE_META_CACHE_MEMORY_PROPORTION: f64 = 0.35;
43
43
const STORAGE_SHARED_BUFFER_MEMORY_PROPORTION : f64 = 0.3 ;
44
44
45
45
/// The proportion of compute memory used for batch processing.
46
- const COMPUTE_BATCH_MEMORY_PROPORTION : f64 = 0.3 ;
46
+ const COMPUTE_BATCH_MEMORY_PROPORTION_FOR_STREAMING : f64 = 0.3 ;
47
+ const COMPUTE_BATCH_MEMORY_PROPORTION_FOR_SERVING : f64 = 0.6 ;
47
48
48
49
/// Each compute node reserves some memory for stack and code segment of processes, allocation
49
50
/// overhead, network buffer, etc. based on gradient reserve memory proportion. The reserve memory
@@ -299,8 +300,12 @@ pub fn storage_memory_config(
299
300
}
300
301
}
301
302
302
- pub fn batch_mem_limit ( compute_memory_bytes : usize ) -> u64 {
303
- ( compute_memory_bytes as f64 * COMPUTE_BATCH_MEMORY_PROPORTION ) as u64
303
+ pub fn batch_mem_limit ( compute_memory_bytes : usize , is_serving_node : bool ) -> u64 {
304
+ if is_serving_node {
305
+ ( compute_memory_bytes as f64 * COMPUTE_BATCH_MEMORY_PROPORTION_FOR_SERVING ) as u64
306
+ } else {
307
+ ( compute_memory_bytes as f64 * COMPUTE_BATCH_MEMORY_PROPORTION_FOR_STREAMING ) as u64
308
+ }
304
309
}
305
310
306
311
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ pub async fn compute_node_serve(
288
288
let batch_mgr = Arc :: new ( BatchManager :: new (
289
289
config. batch . clone ( ) ,
290
290
batch_manager_metrics,
291
- batch_mem_limit ( compute_memory_bytes) ,
291
+ batch_mem_limit ( compute_memory_bytes, opts . role . for_serving ( ) ) ,
292
292
) ) ;
293
293
294
294
// NOTE: Due to some limits, we use `compute_memory_bytes + storage_memory_bytes` as
You can’t perform that action at this time.
0 commit comments