ollama/x/mlxrunner/mlx
Jesse Gross 04f5f0cdb4 mlx: improve thread safety of array management
Use atomic.Int32 for Array.pinned and a sync.Mutex for the global
arrays slice so MLX arrays can be created and pinned from multiple
goroutines without racing on those structures. Convert Array value
receivers to pointer receivers and struct fields from Array to
*Array to avoid copying the atomic.

This does not fully achieve thread safety even when building
completely independent graphs. The tracing flag and traceScratch
slice in compile.go are unprotected, so concurrent Compile calls
will race. MLX itself is not fully thread-safe either although
it is working to improve.
2026-04-21 14:38:49 -07:00
..
generator ci: Fix windows build (#14754) 2026-03-09 19:27:59 -07:00
include/mlx/c mlx: update as of 3/23 (#14789) 2026-03-23 11:28:44 -07:00
.gitignore Add MLX runner with GLM4-MoE-Lite model support (#14185) 2026-02-10 14:57:57 -08:00
act.go mlx: fuse sigmoid router head in glm4_moe_lite 2026-04-20 15:02:14 -07:00
array.go mlx: improve thread safety of array management 2026-04-21 14:38:49 -07:00
array_test.go MLX: add header vendoring and remove go build tag (#14642) 2026-03-09 17:24:45 -07:00
CMakeLists.txt mlx: update as of 3/23 (#14789) 2026-03-23 11:28:44 -07:00
compile.go mlx: improve thread safety of array management 2026-04-21 14:38:49 -07:00
compile_test.go mlx: add compiled closure support 2026-04-14 16:38:32 -07:00
dtype.go MLX: add header vendoring and remove go build tag (#14642) 2026-03-09 17:24:45 -07:00
dynamic.c mlx: remove noisy error output from dynamic library loading (#14346) 2026-02-20 23:46:07 -08:00
dynamic.go mlx: Improve M5 performance with NAX (#15345) 2026-04-07 08:12:24 -07:00
dynamic.h MLX: add header vendoring and remove go build tag (#14642) 2026-03-09 17:24:45 -07:00
dynamic_darwin.go mlx: Improve M5 performance with NAX (#15345) 2026-04-07 08:12:24 -07:00
dynamic_other.go mlx: Improve M5 performance with NAX (#15345) 2026-04-07 08:12:24 -07:00
fast.go mlx: improve thread safety of array management 2026-04-21 14:38:49 -07:00
gated_delta.go mlx: update as of 3/23 (#14789) 2026-03-23 11:28:44 -07:00
generated.c mlx: update as of 3/23 (#14789) 2026-03-23 11:28:44 -07:00
generated.h mlx: update as of 3/23 (#14789) 2026-03-23 11:28:44 -07:00
io.go mlx: add mxfp4/mxfp8/nvfp4 importing (#15015) 2026-03-24 13:45:44 -07:00
memory.go MLX: add header vendoring and remove go build tag (#14642) 2026-03-09 17:24:45 -07:00
mlx.go mlx: add compiled closure support 2026-04-14 16:38:32 -07:00
nn.go mlx: improve thread safety of array management 2026-04-21 14:38:49 -07:00
ops.go mlxrunner: use MaxAxis in the min-P sampler 2026-04-20 17:43:00 -07:00
ops_extra.go models: fuse MLP activation functions via mlx_compile 2026-04-14 16:38:32 -07:00
random.go MLX: add header vendoring and remove go build tag (#14642) 2026-03-09 17:24:45 -07:00
slice.go mlxrunner: fix Slice(0, 0) returning full dimension instead of empty 2026-03-18 16:06:33 -07:00
stream.go MLX: add header vendoring and remove go build tag (#14642) 2026-03-09 17:24:45 -07:00