Allow dynamic ops per buffer based on dispatches and memory (#1864)

* Allow dynamic ops per buffer based on dispatches and memory

* add initial arch values
This commit is contained in:
Awni Hannun
2025-02-13 19:18:22 -08:00
committed by GitHub
parent 9733e16496
commit 7aea5b1895
5 changed files with 62 additions and 21 deletions

View File

@@ -122,11 +122,18 @@ inline int bfs_max_width() {
return bfs_max_width_;
}
inline int max_ops_per_buffer() {
static int max_ops_per_buffer_ = get_var("MLX_MAX_OPS_PER_BUFFER", 10);
inline int max_ops_per_buffer(int default_value) {
static int max_ops_per_buffer_ =
get_var("MLX_MAX_OPS_PER_BUFFER", default_value);
return max_ops_per_buffer_;
}
inline int max_mb_per_buffer(int default_value) {
static int max_mb_per_buffer_ =
get_var("MLX_MAX_MB_PER_BUFFER", default_value);
return max_mb_per_buffer_;
}
inline bool metal_fast_synch() {
static bool metal_fast_synch = get_var("MLX_METAL_FAST_SYNCH", 0);
return metal_fast_synch;