MLX: An array framework for Apple silicon
497 matches across 11 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 17 | def cuda_toolkit_major_version(): |
| LOW | python/tests/test_fast_sdpa.py | 120 | def test_sdpa_vector_kv_transposed_head_seq(self): |
| LOW | python/tests/test_fast_sdpa.py | 307 | def test_sdpa_vector_value_dims(self): |
| LOW | python/tests/test_fast_sdpa.py | 448 | def test_sdpa_long_masked_sequence(self): |
| LOW | python/tests/test_fast_sdpa.py | 501 | def test_sdpa_noncontiguous_inputs(self): |
| LOW | python/tests/test_fast_sdpa.py | 556 | def test_sdpa_attention_sinks(self): |
| LOW | python/tests/test_losses.py | 79 | def test_binary_cross_entropy(self): |
| LOW | python/tests/test_losses.py | 138 | def _test_tiny_probs_as_inputs(): |
| LOW | python/tests/test_losses.py | 381 | def test_cosine_similarity_loss(self): |
| LOW | python/tests/test_fast.py | 172 | def test_rope_dims_validation(self): |
| LOW | python/tests/test_fast.py | 390 | def test_rope_with_large_offset(self): |
| LOW | python/tests/test_fast.py | 513 | def test_layer_norm_dim_check(self): |
| LOW | python/tests/test_fast.py | 610 | def test_slice_into_layer_norm(self): |
| LOW | python/tests/test_fast.py | 661 | def test_layer_norm_grad_no_bias(self): |
| LOW | python/tests/test_fast.py | 697 | def test_layer_norm_grad_no_params(self): |
| LOW | python/tests/test_fast.py | 708 | def test_layer_norm_grad_params(self): |
| LOW | python/tests/test_fast.py | 854 | def test_custom_kernel_strides(self): |
| LOW | python/tests/test_fast.py | 908 | def test_custom_kernel_helper(self): |
| LOW | python/tests/test_fast.py | 954 | def test_custom_kernel_attributes(self): |
| LOW | python/tests/test_fast.py | 980 | def test_custom_kernel_caching(self): |
| LOW | python/tests/test_array.py | 192 | def test_list_not_equals_array(self): |
| LOW | python/tests/test_array.py | 215 | def test_tuple_not_equals_array(self): |
| LOW | python/tests/test_array.py | 225 | def test_obj_inequality_array(self): |
| LOW | python/tests/test_array.py | 385 | def test_construction_from_lists(self): |
| LOW | python/tests/test_array.py | 441 | def test_double_keeps_precision(self): |
| LOW | python/tests/test_array.py | 449 | def test_construction_from_lists_of_mlx_arrays(self): |
| LOW | python/tests/test_array.py | 608 | def test_array_repr_precision(self): |
| LOW | python/tests/test_array.py | 737 | def test_array_np_dtype_conversion(self): |
| LOW | python/tests/test_array.py | 769 | def test_array_from_noncontiguous_np(self): |
| LOW | python/tests/test_array.py | 776 | def test_array_np_shape_dim_check(self): |
| LOW | python/tests/test_array.py | 828 | def test_dtype_python_scalar_promotion(self): |
| LOW | python/tests/test_array.py | 1483 | def test_array_at_slice_update_extensive(self): |
| LOW | python/tests/test_array.py | 1738 | def test_np_array_conversion_copies_by_default(self): |
| LOW | python/tests/test_array.py | 1820 | def test_buffer_protocol_ref_counting(self): |
| LOW | python/tests/test_array.py | 1830 | def test_array_view_ref_counting(self): |
| LOW | python/tests/test_array.py | 1977 | def test_inplace_preserves_ids(self): |
| LOW | python/tests/test_array.py | 1992 | def test_load_from_pickled_np(self): |
| LOW | python/tests/test_array.py | 2051 | def test_torch_mps_dlpack_non_cpu_error(self): |
| LOW | python/tests/test_array.py | 2127 | def test_setitem_with_boolean_mask(self): |
| LOW | python/tests/test_array.py | 2164 | def test_array_namespace_asarray(self): |
| LOW | python/tests/test_array.py | 2283 | def test_siblings_without_eval(self): |
| LOW | python/tests/test_array.py | 2305 | def test_scalar_integer_conversion_overflow(self): |
| LOW | python/tests/test_export_import.py | 134 | def test_export_random_sample(self): |
| LOW | python/tests/test_export_import.py | 203 | def test_export_variable_inputs(self): |
| LOW | python/tests/test_export_import.py | 272 | def test_export_import_shapeless(self): |
| LOW | python/tests/test_export_import.py | 290 | def test_export_scatter_gather(self): |
| LOW | python/tests/test_export_import.py | 349 | def test_export_conv_shapeless(self): |
| LOW | python/tests/test_export_import.py | 466 | def test_export_quantized_model(self): |
| LOW | python/tests/test_export_import.py | 488 | def test_export_kwarg_ordering(self): |
| LOW | python/tests/test_export_import.py | 501 | def test_export_with_callback(self): |
| LOW | python/tests/test_export_import.py | 541 | def test_export_import_custom_kernel(self): |
| LOW | python/tests/test_export_import.py | 584 | def test_export_import_multi_with_constants(self): |
| LOW | python/tests/test_export_import.py | 605 | def test_export_import_scatter_sum(self): |
| LOW | python/tests/test_optimizers.py | 207 | def test_adamw_matches_pytorch(self): |
| LOW | python/tests/test_optimizers.py | 463 | def test_linear_warmup_with_cosine_decay(self): |
| LOW | python/tests/test_optimizers.py | 480 | def test_compile_with_schedule(self): |
| LOW | python/tests/test_nn.py | 106 | def test_save_safetensors_weights(self): |
| LOW | python/tests/test_nn.py | 252 | def test_quantized_sharded_linear_construction(self): |
| LOW | python/tests/test_nn.py | 2009 | def test_transformer_encoder_layer(self): |
| LOW | python/tests/test_nn.py | 2031 | def test_transformer_decoder_layer(self): |
| 95 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 241 | } |
| LOW | python/src/ops.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/utils.h | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/distributed.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | python/src/transforms.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/fast.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/load.h | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/fft.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/array.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/export.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | python/src/buffer.h | 1 | // Copyright © 2024 Apple Inc. |
| LOW | python/src/load.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | python/src/metal.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | tests/allocator_tests.cpp | 1 | // Copyright © 2023-2026 Apple Inc. |
| LOW | tests/random_tests.cpp | 281 | key = array({0u, 0u, 0u}, {3, 1}); |
| LOW | tests/autograd_tests.cpp | 1 | // Copyright © 2023 Apple Inc. |
| LOW | examples/extensions/axpby/axpby.cpp | 1 | // Copyright © 2023-2025 Apple Inc. |
| LOW | mlx/mlx.h | 1 | // Copyright © 2023 Apple Inc. |
| LOW | mlx/mlx.h | 21 | #include "mlx/random.h" |
| LOW | mlx/ops.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/utils.h | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/transforms.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/threadpool.h | 1 | // This code was modified from https://github.com/progschj/ThreadPool |
| LOW | mlx/threadpool.h | 21 | // 3. This notice may not be removed or altered from any source |
| LOW | mlx/small_vector.h | 1 | // Copyright © 2025 Apple Inc. |
| LOW | mlx/small_vector.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| LOW | mlx/small_vector.h | 41 | #else |
| LOW | mlx/small_vector.h | 81 | // Minimal SmallVector implementation. Uses inline storage first, switches to |
| LOW | mlx/scheduler.h | 1 | // Copyright © 2023 Apple Inc. |
| LOW | mlx/api.h | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/api.h | 21 | #define MLX_API __declspec(dllexport) |
| LOW | mlx/export.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/compile.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/compile.cpp | 801 | // Go through the tape in reverse order and check for fusable sub-graphs |
| LOW | mlx/stream.cpp | 1 | // Copyright © 2026 Apple Inc. |
| LOW | mlx/primitives.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/primitives.cpp | 5561 | return {{bitwise_invert(inputs[0], stream())}, axes}; |
| LOW | mlx/primitives.cpp | 5581 | // - dC_m = cotan [..., M, N] |
| LOW | mlx/array.h | 1 | // Copyright © 2023 Apple Inc. |
| LOW | mlx/graph_utils.cpp | 1 | // Copyright © 2023 Apple Inc. |
| LOW | mlx/einsum.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/distributed/jaccl/lib/jaccl/mesh_impl.h | 81 | buff++; |
| LOW | mlx/distributed/jaccl/lib/examples/allreduce_bench.cpp | 1 | // Copyright © 2025 Apple Inc. |
| LOW | mlx/distributed/jaccl/lib/examples/allreduce_bench.cpp | 21 | // |
| LOW | mlx/distributed/jaccl/lib/examples/CMakeLists.txt | 1 | cmake_minimum_required(VERSION 3.24) |
| LOW | mlx/distributed/nccl/nccl.cpp | 1 | // NCCL distributed support currently requires Unix socket APIs |
| LOW | mlx/distributed/mpi/mpi_declarations.h | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/distributed/ring/ring.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/io/load.h | 1 | // Copyright © 2023 Apple Inc. |
| LOW | mlx/io/safetensors.cpp | 1 | // Copyright © 2023 Apple Inc. |
| LOW | mlx/io/safetensors.cpp | 21 | #define ST_BOOL "BOOL" |
| LOW | mlx/io/load.cpp | 1 | // Copyright © 2023-2026 Apple Inc. |
| LOW | mlx/backend/gpu/primitives.cpp | 1 | // Copyright © 2025 Apple Inc. |
| LOW | mlx/backend/metal/quantized.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/backend/metal/distributed.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/backend/metal/device.h | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/backend/metal/matmul.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/backend/metal/compiled.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| LOW | mlx/backend/metal/hadamard.cpp | 1 | // Copyright © 2024 Apple Inc. |
| LOW | mlx/backend/metal/indexing.cpp | 1 | // Copyright © 2023-2024 Apple Inc. |
| 58 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | python/tests/test_fast_sdpa.py | 8 | |
| LOW | python/tests/test_linalg.py | 5 | |
| LOW | python/tests/test_conv_transpose.py | 5 | |
| LOW | python/tests/test_tree.py | 3 | |
| LOW | python/tests/test_losses.py | 3 | |
| LOW | python/tests/test_double.py | 4 | |
| LOW | python/tests/test_double.py | 5 | |
| LOW | python/tests/test_optimizers.py | 18 | |
| LOW | python/tests/test_nn.py | 5 | |
| LOW | python/tests/test_quantized.py | 3 | |
| LOW | python/tests/test_blas.py | 4 | |
| LOW | python/tests/test_blas.py | 5 | |
| LOW | python/tests/test_threads.py | 4 | |
| LOW | python/tests/test_reduce.py | 3 | |
| LOW | python/tests/test_bf16.py | 3 | |
| LOW | python/tests/test_bf16.py | 5 | |
| LOW | python/tests/test_einsum.py | 3 | |
| LOW | python/tests/test_autograd.py | 4 | |
| LOW | python/tests/test_graph.py | 4 | |
| LOW | python/tests/test_init.py | 2 | |
| LOW | python/tests/test_constants.py | 3 | |
| LOW | python/tests/test_vmap.py | 4 | |
| LOW | python/tests/test_eval.py | 4 | |
| LOW | python/tests/test_random.py | 4 | |
| LOW | python/tests/test_conv.py | 6 | |
| LOW | python/mlx/nn/__init__.py | 3 | |
| LOW | python/mlx/nn/__init__.py | 3 | |
| LOW | python/mlx/nn/__init__.py | 4 | |
| LOW | python/mlx/nn/__init__.py | 5 | |
| LOW | python/mlx/nn/__init__.py | 5 | |
| LOW | python/mlx/nn/__init__.py | 5 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| LOW | python/mlx/nn/layers/__init__.py | 3 | |
| 92 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | python/tests/test_fast_sdpa.py | 364 | |
| LOW | python/tests/test_fast_sdpa.py | 653 | |
| LOW | python/tests/test_linalg.py | 13 | |
| LOW | python/tests/test_linalg.py | 68 | |
| LOW | python/tests/test_upsample.py | 21 | |
| LOW | python/tests/test_fast.py | 368 | |
| LOW | python/tests/test_double.py | 115 | |
| LOW | python/tests/test_array.py | 1744 | |
| LOW | python/tests/test_export_import.py | 501 | |
| LOW | python/tests/test_export_import.py | 513 | |
| LOW | python/tests/test_fft.py | 62 | |
| LOW | python/tests/test_blas.py | 308 | |
| LOW | python/tests/test_blas.py | 485 | |
| LOW | python/tests/test_blas.py | 1239 | |
| LOW | python/tests/mpi_test_distributed.py | 31 | |
| LOW | python/tests/test_reduce.py | 12 | |
| LOW | python/tests/test_reduce.py | 29 | |
| LOW | python/tests/test_reduce.py | 50 | |
| LOW | python/tests/test_reduce.py | 86 | |
| LOW | python/tests/test_reduce.py | 156 | |
| LOW | python/tests/test_bf16.py | 127 | |
| LOW | python/tests/test_ops.py | 1566 | |
| LOW | python/tests/test_ops.py | 1633 | |
| LOW | python/tests/test_ops.py | 1728 | |
| LOW | python/tests/test_ops.py | 2364 | |
| LOW | python/tests/test_load.py | 40 | |
| LOW | python/tests/test_load.py | 90 | |
| LOW | python/tests/test_load.py | 131 | |
| LOW | python/tests/test_load.py | 303 | |
| LOW | python/tests/test_load.py | 341 | |
| LOW | python/mlx/nn/layers/quantized.py | 22 | |
| LOW | python/mlx/nn/layers/quantized.py | 69 | |
| LOW | python/mlx/nn/layers/base.py | 619 | |
| LOW | python/mlx/nn/layers/base.py | 649 | |
| LOW | python/mlx/nn/layers/base.py | 304 | |
| LOW | python/mlx/nn/layers/base.py | 325 | |
| LOW | python/mlx/_distributed_utils/config.py | 337 | |
| LOW | python/mlx/_distributed_utils/config.py | 486 | |
| LOW | python/mlx/_distributed_utils/config.py | 515 | |
| LOW | python/mlx/_distributed_utils/launch.py | 170 | |
| LOW | python/mlx/_distributed_utils/launch.py | 457 | |
| LOW | python/mlx/optimizers/optimizers.py | 31 | |
| LOW | python/mlx/optimizers/optimizers.py | 53 | |
| LOW | examples/python/qqmm.py | 22 | |
| LOW | benchmarks/python/hadamard_bench.py | 22 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | python/mlx/nn/losses.py | 31 | Computes the cross entropy loss. Args: logits (array): The unnormalized logits. targets (array |
| HIGH | python/mlx/nn/losses.py | 127 | Computes the binary cross entropy loss. By default, this function takes the pre-sigmoid logits, which results |
| HIGH | python/mlx/nn/losses.py | 565 | Calculate the margin ranking loss that loss given inputs :math:`x_1`, :math:`x_2` and a label :math:`y` (contai |
| HIGH | python/mlx/nn/layers/linear.py | 80 | Return a quantized approximation of this layer. If ``quantize_input`` is ``False``, returns a :obj:`QuantizedLi |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | python/mlx/_distributed_utils/launch.py | 159 | script += "if ps -p $pid >/dev/null; then " |
| HIGH | python/mlx/_distributed_utils/common.py | 51 | {"ssh": "hostname1", "ips": ["123.123.123.1"], "rdma": [null, "rdma_en2", "rdma_en3"]}, |
| HIGH | python/mlx/_distributed_utils/common.py | 52 | {"ssh": "hostname2", "ips": ["123.123.123.2"], "rdma": ["rdma_en2", null, "rdma_en3"]}, |
| HIGH | python/mlx/_distributed_utils/common.py | 54 | {"ssh": "hostnameN", "ips": ["123.123.123.N"], "rdma": ["rdma_en2", "rdma_en3", null]}, |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | python/tests/test_einsum.py | 192 | |
| MEDIUM | python/tests/test_einsum.py | 193 | |
| MEDIUM | python/tests/test_einsum.py | 195 | |
| MEDIUM | python/tests/test_einsum.py | 196 | |
| MEDIUM | python/tests/test_einsum.py | 197 | |
| MEDIUM | python/tests/test_einsum.py | 198 | |
| MEDIUM | python/tests/test_einsum.py | 199 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | python/mlx/utils.py | 161 | # Create the function to update the destination. We are taking advantage of |
| MEDIUM | python/mlx/_distributed_utils/config.py | 256 | # Create a reverse index to be able to map uuids to (host, port) quickly |
| MEDIUM | python/src/stream.cpp | 158 | # Create a context manager for the default device and stream. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 134 | # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level |
| LOW | python/tests/test_constants.py | 12 | # Check if mlx constants match expected values |
| LOW | python/tests/test_constants.py | 25 | # Check if mlx constants are available |
| LOW | python/mlx/extension.py | 53 | # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level |
| LOW | python/mlx/_distributed_utils/launch.py | 267 | # Check if all are running and terminate otherwise |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | python/mlx/_distributed_utils/common.py | 85 | except Exception as e: |
| LOW | benchmarks/python/masked_scatter.py | 36 | except Exception: |
| LOW | benchmarks/python/masked_scatter.py | 45 | except Exception: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | mlx/distributed/jaccl/lib/jaccl/rdma.h | 337 | // Twice has proven to be more robust to initialization issues. |