[package]
edition = "2021"
rust-version = "1.81.0"
name = "mlx-native"
version = "0.6.7"
authors = ["mlx-native contributors"]
build = false
exclude = [
".claude/",
"_bmad/",
"_bmad-output/",
"docs/",
".github/",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Pure-Rust Metal GPU compute library for MLX-compatible inference on Apple Silicon"
homepage = "https://github.com/robertelee78/mlx-native"
documentation = "https://docs.rs/mlx-native"
readme = "README.md"
keywords = [
"metal",
"gpu",
"mlx",
"inference",
"apple-silicon",
]
categories = [
"os::macos-apis",
"science",
]
license = "MIT"
repository = "https://github.com/robertelee78/mlx-native"
[package.metadata.docs.rs]
default-target = "aarch64-apple-darwin"
targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
]
all-features = true
[package.metadata.release]
pre-release-hook = [
"cargo",
"semver-checks",
]
tag-prefix = "v"
tag-name = "{{prefix}}{{version}}"
push-remote = "origin"
[features]
default = []
test-utils = []
[lib]
name = "mlx_native"
path = "src/lib.rs"
[[bin]]
name = "bench_qmm_affine"
path = "src/bin/bench_qmm_affine.rs"
[[example]]
name = "cb_cost_calibration"
path = "examples/cb_cost_calibration.rs"
[[example]]
name = "dispatch_cost_calibration"
path = "examples/dispatch_cost_calibration.rs"
[[example]]
name = "tq_distribution_analyze"
path = "examples/tq_distribution_analyze.rs"
[[example]]
name = "tq_kernel_replay"
path = "examples/tq_kernel_replay.rs"
[[test]]
name = "bench_sdpa_tq"
path = "tests/bench_sdpa_tq.rs"
[[test]]
name = "bitwidth_ab"
path = "tests/bitwidth_ab.rs"
[[test]]
name = "dispatch_profile"
path = "tests/dispatch_profile.rs"
[[test]]
name = "encoder_session_cb_count_smoke"
path = "tests/encoder_session_cb_count_smoke.rs"
[[test]]
name = "encoder_session_lifecycle"
path = "tests/encoder_session_lifecycle.rs"
[[test]]
name = "encoder_session_multistage"
path = "tests/encoder_session_multistage.rs"
[[test]]
name = "encoder_session_wait_event_smoke"
path = "tests/encoder_session_wait_event_smoke.rs"
[[test]]
name = "metal_capture"
path = "tests/metal_capture.rs"
[[test]]
name = "metal_capture_happy_path"
path = "tests/metal_capture_happy_path.rs"
[[test]]
name = "perf_chunk_scan_chunk_o"
path = "tests/perf_chunk_scan_chunk_o.rs"
[[test]]
name = "perf_chunk_scan_inter_state"
path = "tests/perf_chunk_scan_inter_state.rs"
[[test]]
name = "round_trip_identity"
path = "tests/round_trip_identity.rs"
[[test]]
name = "test_argmax"
path = "tests/test_argmax.rs"
[[test]]
name = "test_argsort"
path = "tests/test_argsort.rs"
[[test]]
name = "test_auto_barrier"
path = "tests/test_auto_barrier.rs"
[[test]]
name = "test_barrier_counter"
path = "tests/test_barrier_counter.rs"
[[test]]
name = "test_batch_kernels"
path = "tests/test_batch_kernels.rs"
[[test]]
name = "test_bf16_kernels"
path = "tests/test_bf16_kernels.rs"
[[test]]
name = "test_cb_label_propagation"
path = "tests/test_cb_label_propagation.rs"
[[test]]
name = "test_chunk_gated_delta_rule_fwd"
path = "tests/test_chunk_gated_delta_rule_fwd.rs"
[[test]]
name = "test_chunk_tri_solve_invert"
path = "tests/test_chunk_tri_solve_invert.rs"
[[test]]
name = "test_copy"
path = "tests/test_copy.rs"
[[test]]
name = "test_cumsum"
path = "tests/test_cumsum.rs"
[[test]]
name = "test_dense_gemm"
path = "tests/test_dense_gemm.rs"
[[test]]
name = "test_dense_mm_bf16"
path = "tests/test_dense_mm_bf16.rs"
[[test]]
name = "test_dense_mm_f16"
path = "tests/test_dense_mm_f16.rs"
[[test]]
name = "test_dense_mm_f32_f32"
path = "tests/test_dense_mm_f32_f32.rs"
[[test]]
name = "test_elementwise"
path = "tests/test_elementwise.rs"
[[test]]
name = "test_embedding"
path = "tests/test_embedding.rs"
[[test]]
name = "test_flash_attn_prefill"
path = "tests/test_flash_attn_prefill.rs"
[[test]]
name = "test_flash_attn_vec"
path = "tests/test_flash_attn_vec.rs"
[[test]]
name = "test_flash_attn_vec_tq"
path = "tests/test_flash_attn_vec_tq.rs"
[[test]]
name = "test_fused_ops"
path = "tests/test_fused_ops.rs"
[[test]]
name = "test_gated_delta_net"
path = "tests/test_gated_delta_net.rs"
[[test]]
name = "test_gated_delta_net_chunk"
path = "tests/test_gated_delta_net_chunk.rs"
[[test]]
name = "test_gated_delta_net_chunk_o"
path = "tests/test_gated_delta_net_chunk_o.rs"
[[test]]
name = "test_gated_delta_net_decode"
path = "tests/test_gated_delta_net_decode.rs"
[[test]]
name = "test_gated_delta_net_kkt"
path = "tests/test_gated_delta_net_kkt.rs"
[[test]]
name = "test_gated_delta_net_recompute_wu"
path = "tests/test_gated_delta_net_recompute_wu.rs"
[[test]]
name = "test_gather"
path = "tests/test_gather.rs"
[[test]]
name = "test_gather_bench"
path = "tests/test_gather_bench.rs"
[[test]]
name = "test_gelu"
path = "tests/test_gelu.rs"
[[test]]
name = "test_gguf_load_tensor_into_pool"
path = "tests/test_gguf_load_tensor_into_pool.rs"
[[test]]
name = "test_graph"
path = "tests/test_graph.rs"
[[test]]
name = "test_hadamard"
path = "tests/test_hadamard.rs"
[[test]]
name = "test_hadamard_quantize_kv"
path = "tests/test_hadamard_quantize_kv.rs"
[[test]]
name = "test_kv_cache"
path = "tests/test_kv_cache.rs"
[[test]]
name = "test_l2_norm"
path = "tests/test_l2_norm.rs"
[[test]]
name = "test_moe_dispatch"
path = "tests/test_moe_dispatch.rs"
[[test]]
name = "test_moe_gate"
path = "tests/test_moe_gate.rs"
[[test]]
name = "test_q4_k_kernels"
path = "tests/test_q4_k_kernels.rs"
[[test]]
name = "test_q5_k_dequant"
path = "tests/test_q5_k_dequant.rs"
[[test]]
name = "test_qkv_split"
path = "tests/test_qkv_split.rs"
[[test]]
name = "test_quantized_matmul"
path = "tests/test_quantized_matmul.rs"
[[test]]
name = "test_quantized_matmul_ggml"
path = "tests/test_quantized_matmul_ggml.rs"
[[test]]
name = "test_quantized_matmul_id"
path = "tests/test_quantized_matmul_id.rs"
[[test]]
name = "test_quantized_matmul_id_ggml"
path = "tests/test_quantized_matmul_id_ggml.rs"
[[test]]
name = "test_quantized_matmul_id_mm"
path = "tests/test_quantized_matmul_id_mm.rs"
[[test]]
name = "test_quantized_matmul_id_swiglu"
path = "tests/test_quantized_matmul_id_swiglu.rs"
[[test]]
name = "test_quantized_matmul_mm"
path = "tests/test_quantized_matmul_mm.rs"
[[test]]
name = "test_repeat_tiled"
path = "tests/test_repeat_tiled.rs"
[[test]]
name = "test_residency_set"
path = "tests/test_residency_set.rs"
[[test]]
name = "test_rms_norm"
path = "tests/test_rms_norm.rs"
[[test]]
name = "test_rms_norm_no_scale_f32"
path = "tests/test_rms_norm_no_scale_f32.rs"
[[test]]
name = "test_rope"
path = "tests/test_rope.rs"
[[test]]
name = "test_rope_multi"
path = "tests/test_rope_multi.rs"
[[test]]
name = "test_rope_neox_f32"
path = "tests/test_rope_neox_f32.rs"
[[test]]
name = "test_sampling"
path = "tests/test_sampling.rs"
[[test]]
name = "test_scale_mask_softmax"
path = "tests/test_scale_mask_softmax.rs"
[[test]]
name = "test_sdpa"
path = "tests/test_sdpa.rs"
[[test]]
name = "test_sigmoid_mul"
path = "tests/test_sigmoid_mul.rs"
[[test]]
name = "test_softcap"
path = "tests/test_softcap.rs"
[[test]]
name = "test_softmax"
path = "tests/test_softmax.rs"
[[test]]
name = "test_ssm_conv"
path = "tests/test_ssm_conv.rs"
[[test]]
name = "test_tq_hb_encoder_byte_parity"
path = "tests/test_tq_hb_encoder_byte_parity.rs"
[[test]]
name = "test_transpose_extended"
path = "tests/test_transpose_extended.rs"
[[test]]
name = "test_tri_solve"
path = "tests/test_tri_solve.rs"
[[test]]
name = "test_turboquant"
path = "tests/test_turboquant.rs"
[[test]]
name = "test_unretained_refs"
path = "tests/test_unretained_refs.rs"
[[test]]
name = "test_vision_2d_rope"
path = "tests/test_vision_2d_rope.rs"
[[bench]]
name = "bench_chunk_scan_pipeline"
path = "benches/bench_chunk_scan_pipeline.rs"
harness = false
[[bench]]
name = "bench_gather"
path = "benches/bench_gather.rs"
harness = false
[[bench]]
name = "bench_hadamard"
path = "benches/bench_hadamard.rs"
harness = false
[[bench]]
name = "bench_moe_dispatch"
path = "benches/bench_moe_dispatch.rs"
harness = false
[[bench]]
name = "bench_moe_q_qwen36_shape"
path = "benches/bench_moe_q_qwen36_shape.rs"
harness = false
[[bench]]
name = "bench_mtl_event_cost"
path = "benches/bench_mtl_event_cost.rs"
harness = false
[[bench]]
name = "bench_mul_mm_id_qwen36_ffn"
path = "benches/bench_mul_mm_id_qwen36_ffn.rs"
harness = false
[[bench]]
name = "bench_prefill_qmatmul_shapes"
path = "benches/bench_prefill_qmatmul_shapes.rs"
harness = false
[[bench]]
name = "bench_quantized_matmul"
path = "benches/bench_quantized_matmul.rs"
harness = false
[[bench]]
name = "bench_sdpa"
path = "benches/bench_sdpa.rs"
harness = false
[dependencies.bytemuck]
version = "1"
features = ["derive"]
[dependencies.half]
version = "2"
features = ["bytemuck"]
[dependencies.memmap2]
version = "0.9"
[dependencies.metal]
version = "0.33"
[dependencies.objc]
version = "0.2"
[dependencies.safetensors]
version = "0.7"
[dependencies.serde]
version = "1"
features = ["derive"]
[dependencies.serde_json]
version = "1"
[dependencies.thiserror]
version = "2"
[dev-dependencies.criterion]
version = "0.5"
features = ["html_reports"]
[dev-dependencies.static_assertions]
version = "1"