mlx-rocm 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mlx_rocm-0.1.2/CMakeLists.txt +94 -0
- mlx_rocm-0.1.2/LICENSE +21 -0
- mlx_rocm-0.1.2/MANIFEST.in +10 -0
- mlx_rocm-0.1.2/PKG-INFO +190 -0
- mlx_rocm-0.1.2/README.md +175 -0
- mlx_rocm-0.1.2/examples/gemm_smoke.cpp +167 -0
- mlx_rocm-0.1.2/pyproject.toml +79 -0
- mlx_rocm-0.1.2/scripts/smoke.sh +126 -0
- mlx_rocm-0.1.2/setup.cfg +4 -0
- mlx_rocm-0.1.2/src/cpp/mlx_rocm/gemm/gemm.h +59 -0
- mlx_rocm-0.1.2/src/cpp/mlx_rocm/gemm/gemm_ref.h +74 -0
- mlx_rocm-0.1.2/src/cpp/mlx_rocm/gemm/hipblaslt.cpp +353 -0
- mlx_rocm-0.1.2/src/python/mlx_rocm/__init__.py +10 -0
- mlx_rocm-0.1.2/src/python/mlx_rocm/gemm.py +202 -0
- mlx_rocm-0.1.2/src/python/mlx_rocm.egg-info/PKG-INFO +190 -0
- mlx_rocm-0.1.2/src/python/mlx_rocm.egg-info/SOURCES.txt +757 -0
- mlx_rocm-0.1.2/src/python/mlx_rocm.egg-info/dependency_links.txt +1 -0
- mlx_rocm-0.1.2/src/python/mlx_rocm.egg-info/top_level.txt +1 -0
- mlx_rocm-0.1.2/tests/test_gates.py +60 -0
- mlx_rocm-0.1.2/tests/test_gdn_fuse.py +147 -0
- mlx_rocm-0.1.2/tests/test_gpu.py +128 -0
- mlx_rocm-0.1.2/tests/test_qmv_mr2_lx_instantiation.py +93 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/CMakeLists.upstream.txt +531 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/LICENSE.upstream +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/README.md +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/ci/build_rocm.yml +97 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/3rdparty/.clang-format +2 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/3rdparty/pocketfft.h +3581 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/CMakeLists.txt +125 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/allocator.h +77 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/api.h +29 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/array.cpp +356 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/array.h +676 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/CMakeLists.txt +10 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/binary.h +97 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/broadcasting.cpp +24 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/broadcasting.h +11 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/buffer_cache.h +183 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/common.cpp +267 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/compiled.cpp +245 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/compiled.h +100 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/copy.h +50 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/hadamard.h +109 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/load.cpp +57 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/matmul.h +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/metal_kernel.cpp +378 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/metal_kernel.h +27 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/quantized.h +14 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/reduce.cpp +154 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/reduce.h +59 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/slicing.cpp +71 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/slicing.h +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/ternary.h +85 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/unary.h +29 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/utils.cpp +248 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/common/utils.h +238 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/CMakeLists.txt +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/arange.h +28 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/arg_reduce.cpp +85 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/binary.cpp +234 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/binary.h +421 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/binary_ops.h +98 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/binary_two.h +166 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/cholesky.cpp +88 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/compiled.cpp +377 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/compiled_preamble.h +12 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/conv.cpp +1293 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/copy.cpp +308 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/copy.h +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/device_info.cpp +113 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/device_info.h +28 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/distributed.cpp +120 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/eig.cpp +289 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/eigh.cpp +251 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/encoder.cpp +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/encoder.h +69 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/eval.cpp +54 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/eval.h +15 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/fft.cpp +120 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/gemm.h +26 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/gemms/bnns.cpp +214 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/gemms/cblas.cpp +134 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/gemms/simd_bf16.cpp +45 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/gemms/simd_fp16.cpp +45 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/gemms/simd_gemm.h +139 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/hadamard.cpp +121 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/indexing.cpp +753 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/inverse.cpp +160 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/jit_compiler.cpp +329 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/jit_compiler.h +29 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/lapack.h +80 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/logsumexp.cpp +139 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/luf.cpp +119 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/make_compiled_preamble.ps1 +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/make_compiled_preamble.sh +40 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/masked_mm.cpp +552 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/matmul.cpp +154 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/primitives.cpp +406 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/qrf.cpp +155 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/quantized.cpp +1375 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/reduce.cpp +630 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/scan.cpp +370 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/select.cpp +53 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/accelerate_fp16_simd.h +56 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/accelerate_simd.h +341 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/base_simd.h +345 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/math.h +211 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/neon_fp16_simd.h +212 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/simd.h +4 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/simd/type.h +11 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/slicing.h +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/softmax.cpp +162 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/sort.cpp +490 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/svd.cpp +318 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/ternary.h +154 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/threefry.cpp +31 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/threefry.h +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/unary.cpp +238 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/unary.h +223 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cpu/unary_ops.h +176 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/CMakeLists.txt +335 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/allocator.cpp +457 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/allocator.h +94 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/arange.cu +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/arg_reduce.cu +196 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/bin2h.cmake +150 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/CMakeLists.txt +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/add.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/arctan2.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/binary.cuh +405 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/bitwise_binary.cu +27 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/divide.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/equal.cu +15 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/greater.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/greater_equal.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/less.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/less_equal.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/log_add_exp.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/logical_and.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/logical_or.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/maximum.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/minimum.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/multiply.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/not_equal.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/power.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/remainder.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary/subtract.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/binary_two.cu +411 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cholesky.cu +141 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/compiled.cpp +357 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/conv/conv.h +126 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/conv/gemm_conv.cu +222 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/conv/gemm_grouped_conv.cu +237 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/conv.cpp +406 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/copy/copy.cuh +55 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/copy/copy_contiguous.cu +87 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/copy/copy_general.cu +171 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/copy/copy_general_dynamic.cu +116 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/copy/copy_general_input.cu +228 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/copy.cu +132 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cross_entropy.cu +245 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cublas_utils.cpp +236 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cublas_utils.h +99 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cuda.h +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cuda_utils.h +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cudnn_utils.cpp +190 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cudnn_utils.h +196 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cusolver_utils.cpp +47 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cusolver_utils.h +18 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/custom_kernel.cpp +391 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/cutlass_utils.cuh +68 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/delayload.cpp +106 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/atomic_ops.cuh +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/binary_ops.cuh +309 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/cast_op.cuh +118 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/complex.cuh +60 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/config.h +12 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/cute_dequant.cuh +208 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/fp16_math.cuh +96 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/gather.cuh +53 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/gather_axis.cuh +65 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/gemm_sm70.cuh +285 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/hadamard.cuh +184 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/indexing.cuh +30 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/qmm_naive.cuh +320 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/qmm_sm80.cuh +358 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/qmm_sm90.cuh +91 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/scatter.cuh +155 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/scatter_axis.cuh +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/scatter_ops.cuh +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/slice_update.cuh +75 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/ternary_ops.cuh +13 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/unary_ops.cuh +350 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device/utils.cuh +467 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device.cpp +626 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device.h +220 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/device_info.cpp +232 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/dirs.cpp +49 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/distributed.cu +121 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/eval.cpp +98 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/event.cu +411 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/event.h +95 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/fence.cpp +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/fft.cu +443 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/block_mask.cu +176 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/block_mask.h +28 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/cublas_gemm.cpp +238 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/cublas_gemm.h +114 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/cublas_gemm_batched_12_0.cpp +77 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/cublas_gemm_batched_12_9.cu +325 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/gather_gemm.cu +114 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/gather_gemm.h +23 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/gemv.cu +344 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/gemv.h +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/grouped_gemm.h +39 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/gemms/grouped_gemm_unaligned.cu +490 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/hadamard.cu +245 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/indexing.cpp +687 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/jit_module.cpp +503 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/jit_module.h +119 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/kernel_utils.cu +64 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/kernel_utils.cuh +152 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/layer_norm.cu +415 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/load.cpp +60 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/logsumexp.cu +160 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/lru_cache.h +196 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/matmul.cpp +471 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/no_cuda.cpp +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/primitives.cpp +53 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/ptx.cuh +125 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/affine_quantize.cu +366 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/convert_fp8.cu +19 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/cublas_qqmm.cpp +257 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/cublas_qqmm.h +100 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/fp_quantize.cu +410 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/fp_quantize.cuh +601 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/mxfp8_quantize.cuh +23 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/no_qqmm_impl.cpp +25 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/nvfp4_quantize.cuh +326 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/fp_qmv.cu +326 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmm.cu +187 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmm.h +147 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmm_naive.cu +121 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmm_sm80.cu +116 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmm_sm90.cu +207 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmm_utils.h +72 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qmm/qmv.cu +537 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qqmm.cpp +277 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qqmm_impl.cpp +57 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qqmm_impl.h +37 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qqmm_utils.cu +257 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/qqmm_utils.h +62 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/quantized.cpp +334 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/quantized.h +57 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/quantized/quantized_utils.h +50 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/random.cu +200 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/all_reduce.cu +149 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/col_reduce.cu +502 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/init_reduce.cu +53 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/reduce.cuh +71 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/reduce_ops.cuh +211 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/reduce_utils.cuh +145 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce/row_reduce.cu +366 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/reduce.cu +81 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/rms_norm.cu +886 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/rope.cu +422 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/scaled_dot_product_attention.cpp +717 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/scaled_dot_product_attention.cu +793 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/scan.cu +484 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/slicing.cpp +116 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/softmax.cu +161 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/sort.cu +1162 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/steel/defines.cuh +9 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/steel/gemm.cuh +101 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/steel/mma.cuh +117 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/steel/tiles.cuh +450 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/steel/utils.cuh +89 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/ternary.cu +268 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/CMakeLists.txt +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/abs.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/arccos.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/arccosh.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/arcsin.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/arcsinh.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/arctan.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/arctanh.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/bitwise_invert.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/ceil.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/conjugate.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/cos.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/cosh.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/erf.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/erf_inv.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/exp.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/expm1.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/floor.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/imag.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/log.cu +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/log1p.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/logical_not.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/negative.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/real.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/round.cu +18 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/sigmoid.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/sign.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/sin.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/sinh.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/sqrt.cu +15 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/square.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/tan.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/tanh.cu +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/unary/unary.cuh +222 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/utils.cpp +101 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/utils.h +49 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/vector_types.cuh +48 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/wddm.cpp +107 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/wddm.h +26 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/worker.cpp +91 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/cuda/worker.h +59 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/CMakeLists.txt +5 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/copy.cpp +99 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/copy.h +59 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/device_info.h +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/eval.h +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/primitives.cpp +306 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/scan.h +17 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/slicing.cpp +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/gpu/slicing.h +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/CMakeLists.txt +163 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/allocator.cpp +279 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/allocator.h +80 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/binary.cpp +241 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/binary.h +33 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/compiled.cpp +472 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/conv.cpp +1806 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/copy.cpp +235 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/custom_kernel.cpp +115 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/device.cpp +968 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/device.h +260 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/device_info.cpp +64 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/distributed.cpp +38 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/eval.cpp +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/event.cpp +83 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/event.h +31 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/fence.cpp +135 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/fft.cpp +873 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/gated_delta_update.cpp +167 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/hadamard.cpp +201 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/indexing.cpp +880 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/jit/includes.h +65 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/jit/indexing.h +82 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/jit_kernels.cpp +1414 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/CMakeLists.txt +215 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/arange.h +9 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/arange.metal +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/arg_reduce.metal +194 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/atomic.h +358 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/bf16.h +16 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/bf16_math.h +380 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/binary.h +199 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/binary.metal +109 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/binary_ops.h +339 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/binary_two.h +244 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/binary_two.metal +54 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/cexpf.h +134 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/complex.h +303 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/conv.metal +712 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/copy.h +276 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/copy.metal +75 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/defines.h +24 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/dot.h +68 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/dot.metal +18 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/erf.h +69 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/expm1f.h +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fence.metal +52 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fft/radix.h +363 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fft/readwrite.h +707 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fft.h +599 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fft.metal +71 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fp4.h +51 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fp8.h +91 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fp_quantized.h +2368 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fp_quantized.metal +264 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fp_quantized_nax.h +1072 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/fp_quantized_nax.metal +122 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gated_delta_update.h +349 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gated_delta_update.metal +42 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gated_delta_update_nax.h +527 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gated_delta_update_nax.metal +31 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gemv.h +1044 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gemv.metal +148 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gemv_masked.h +827 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/gemv_masked.metal +76 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/hadamard.h +182 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/gather.h +51 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/gather_axis.h +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/gather_front.h +24 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/indexing.h +23 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/masked_scatter.h +41 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/scatter.h +139 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/indexing/scatter_axis.h +52 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/layer_norm.metal +433 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/logging.h +26 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/logsumexp.h +140 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/logsumexp.metal +18 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/quantized.h +2787 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/quantized.metal +182 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/quantized_nax.h +1687 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/quantized_nax.metal +112 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/quantized_utils.h +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/random.metal +103 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduce.h +5 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduce.metal +172 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduce_utils.h +6 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduction/ops.h +293 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduction/reduce_all.h +66 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduction/reduce_col.h +398 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduction/reduce_init.h +8 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/reduction/reduce_row.h +370 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/rms_norm.metal +427 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/rope.metal +229 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/scaled_dot_product_attention.metal +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/scan.h +532 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/scan.metal +109 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/sdpa_vector.h +538 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/searchsorted.h +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/searchsorted.metal +28 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/softmax.h +190 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/softmax.metal +24 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/sort.h +735 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/sort.metal +82 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/attn.h +296 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/kernels/steel_attention.h +476 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/kernels/steel_attention.metal +31 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/kernels/steel_attention_nax.h +907 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/kernels/steel_attention_nax.metal +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/loader.h +264 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/mma.h +756 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/nax.h +898 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/params.h +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/attn/transforms.h +71 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/conv.h +13 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/kernels/steel_conv.h +176 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/kernels/steel_conv.metal +56 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/kernels/steel_conv_3d.h +135 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/kernels/steel_conv_3d.metal +48 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/kernels/steel_conv_general.h +225 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/kernels/steel_conv_general.metal +47 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/loader.h +6 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/loaders/loader_channel_l.h +955 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/loaders/loader_channel_n.h +319 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/loaders/loader_general.h +381 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/conv/params.h +103 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/defines.h +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/gemm.h +295 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/gemm_nax.h +141 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_fused.h +346 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_fused.metal +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_fused_nax.h +218 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_fused_nax.metal +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_gather.h +459 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_gather.metal +59 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_gather_nax.h +136 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_gather_nax.metal +38 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_masked.h +719 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_masked.metal +76 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_segmented.h +266 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_segmented.metal +43 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_segmented_nax.h +125 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_segmented_nax.metal +31 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_splitk.h +227 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_splitk.metal +76 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_splitk_nax.h +145 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/kernels/steel_gemm_splitk_nax.metal +32 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/loader.h +137 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/mma.h +1159 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/nax.h +898 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/params.h +65 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/gemm/transforms.h +72 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/utils/integral_constant.h +131 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/utils/type_traits.h +55 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/steel/utils.h +42 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/ternary.h +145 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/ternary.metal +48 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/ternary_ops.h +10 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/unary.h +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/unary.metal +115 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/unary_ops.h +454 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels/utils.h +495 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/kernels.h +470 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/logsumexp.cpp +95 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/make_compiled_preamble.sh +141 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/matmul.cpp +3101 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/matmul.h +144 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/metal.cpp +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/metal.h +30 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/no_metal.cpp +33 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/nojit_kernels.cpp +529 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/normalization.cpp +440 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/primitives.cpp +240 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/quantized.cpp +2292 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/reduce.cpp +1064 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/reduce.h +41 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/resident.cpp +239 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/resident.h +123 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/rope.cpp +166 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/scaled_dot_product_attention.cpp +1032 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/scan.cpp +144 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/slicing.cpp +99 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/softmax.cpp +87 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/sort.cpp +419 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/ternary.cpp +160 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/ternary.h +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/unary.cpp +161 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/unary.h +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/utils.cpp +77 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/metal/utils.h +99 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_cpu/CMakeLists.txt +7 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_cpu/compiled.cpp +25 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_cpu/device_info.cpp +22 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_cpu/primitives.cpp +148 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/CMakeLists.txt +8 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/allocator.cpp +216 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/apple_memory.h +16 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/device_info.cpp +22 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/eval.cpp +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/event.cpp +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/fence.cpp +30 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/linux_memory.h +22 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/no_gpu/primitives.cpp +206 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/CMakeLists.txt +403 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/all_reduce.hip +324 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/allocator.cpp +1217 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/allocator.h +202 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/arange.hip +140 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/arg_reduce.hip +342 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/bin2h.cmake +47 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/binary.hip +397 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/binary_two.hip +245 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/compiled.cpp +1022 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/conv/conv.cpp +93 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/conv/conv.h +126 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/conv/gemm_conv.hip +585 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/copy/copy.hpp +238 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/copy/copy_contiguous.hip +96 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/copy/copy_general.hip +102 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/copy/copy_general_dynamic.hip +261 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/copy/copy_general_input.hip +147 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/copy.hip +357 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/custom_kernel.cpp +357 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/arange.hpp +17 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/atomic_ops.hpp +302 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/binary_ops.hpp +486 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/cast_op.hpp +294 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/config.h +193 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/fp16_math.hpp +436 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/gather.hpp +48 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/gather_axis.hpp +66 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/hip_complex_math.hpp +172 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/indexing.hpp +31 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/scatter.hpp +64 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/scatter_axis.hpp +68 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/scatter_ops.hpp +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/ternary_ops.hpp +33 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/unary_ops.hpp +556 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device/utils.hpp +774 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device.cpp +1643 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device.h +492 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/device_info.cpp +147 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/distributed.hip +132 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/eval.cpp +542 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/event.h +81 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/event.hip +429 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/fence.cpp +29 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/flash_attention.hip +671 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/flash_attention_bwd_wmma.hip +504 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/flash_attention_wmma.hip +567 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/g1_hiplog.h +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gated_delta_update.cpp +347 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/gemv.h +34 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/gemv.hip +854 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/hipblaslt_gemm.cpp +1684 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/hipblaslt_gemm.h +163 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/naive_gemm.h +291 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/naive_gemm.hip +2387 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/rocblas_gemm.cpp +678 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/gemms/rocblas_gemm.h +71 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/host_stage.cpp +119 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/indexing.hip +1576 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/iterators/general_iterator.hpp +153 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/iterators/strided_iterator.hpp +106 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/jit_module.cpp +519 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/jit_module.h +163 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/kernel_utils.hip +29 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/kernel_utils.hpp +252 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/layer_norm.hip +488 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/load.cpp +99 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/logsumexp.hip +195 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/lru_cache.h +122 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/matmul.cpp +2089 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/moe_swiglu.cpp +1279 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/no_rocm.cpp +71 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/primitives.cpp +63 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/primitives.hip +21 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/affine_quantize.hip +356 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/convert_fp8.hip +179 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/fp_quantize.hip +306 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/qdequant.hpp +185 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/qmm.hip +7872 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/qmv_kernel.hip +224 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/qmv_lx_kernel.hip +178 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/qmv_tiled_kernel.hip +505 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/qmv_wide_mr_kernel.hip +266 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/quantized.cpp +83 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/quantized/quantized.h +51 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/r4d_gdn_chunk_scan_k128_v128_c64_bf16.hip +1019 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/r4d_gdn_kkt_solve_k128_c64_bf16.hip +358 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/r4d_gdn_recurrent_update_k128_v128_bf16_fp32state.hip +140 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/r4d_gdn_wmma.h +154 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/random.hip +216 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/all_reduce.hip +298 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/col_reduce.hip +488 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/init_reduce.hip +81 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/reduce.hpp +294 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/reduce_ops.hpp +323 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/reduce_utils.hpp +157 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce/row_reduce.hip +350 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/reduce.hip +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/rms_norm.hip +675 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/rocm.cpp +52 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/rocm.h +54 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/rope.hip +614 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/scaled_dot_product_attention.cpp +341 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/scaled_dot_product_attention.hip +439 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/scan.hip +632 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/slicing.cpp +151 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/softmax.hip +372 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/sort.hip +744 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/ternary.hip +221 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/unary.hip +334 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/utils.cpp +100 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/utils.h +87 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/worker.cpp +174 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/backend/rocm/worker.h +79 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/compile.cpp +1286 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/compile.h +45 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/compile_impl.h +77 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/device.cpp +82 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/device.h +64 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/CMakeLists.txt +14 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/distributed.cpp +236 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/distributed.h +93 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/distributed_impl.h +59 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/.gitignore +1 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/CMakeLists.txt +9 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/jaccl.cpp +193 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/jaccl.h +17 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/CMakeLists.txt +83 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/README.md +333 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/examples/CMakeLists.txt +41 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/examples/allreduce_bench.cpp +286 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/examples/minimal_barrier.cpp +42 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/examples/minimal_cfg.cpp +36 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/examples/minimal_env.cpp +28 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/group.h +69 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/jaccl.cpp +302 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/jaccl.h +108 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/mesh.cpp +229 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/mesh.h +91 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/mesh_impl.h +632 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/rdma.cpp +389 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/rdma.h +363 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/reduction_ops.h +217 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/ring.cpp +258 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/ring.h +96 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/ring_impl.h +825 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/tcp.cpp +206 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/tcp.h +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/threadpool.h +137 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/lib/jaccl/types.h +263 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/jaccl/no_jaccl.cpp +27 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/mpi/CMakeLists.txt +5 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/mpi/mpi.cpp +519 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/mpi/mpi.h +12 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/mpi/mpi_declarations.h +28 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/mpi/no_mpi.cpp +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/nccl/CMakeLists.txt +12 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/nccl/nccl.cpp +474 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/nccl/nccl.h +12 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/nccl/no_nccl.cpp +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/ops.cpp +170 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/ops.h +57 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/primitives.cpp +95 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/primitives.h +156 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/reduction_ops.h +38 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/ring/CMakeLists.txt +5 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/ring/no_ring.cpp +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/ring/ring.cpp +847 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/ring/ring.h +12 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/utils.cpp +199 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/distributed/utils.h +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/dtype.cpp +197 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/dtype.h +116 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/dtype_utils.cpp +42 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/dtype_utils.h +119 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/einsum.cpp +952 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/einsum.h +23 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/error.h +49 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/event.h +90 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/export.cpp +1186 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/export.h +143 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/export_impl.h +110 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/fast.cpp +1416 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/fast.h +155 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/fast_primitives.h +599 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/fence.h +44 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/fft.cpp +338 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/fft.h +237 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/graph_utils.cpp +175 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/graph_utils.h +67 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/CMakeLists.txt +30 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/gguf.cpp +594 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/gguf.h +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/gguf_quants.cpp +173 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/load.cpp +433 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/load.h +227 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/no_gguf.cpp +20 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/no_safetensors.cpp +37 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io/safetensors.cpp +308 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/io.h +61 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/linalg.cpp +897 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/linalg.h +119 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/memory.cpp +30 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/memory.h +93 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/mlx.h +25 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/ops.cpp +6847 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/ops.h +1823 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/primitives.cpp +6325 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/primitives.h +2607 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/random.cpp +530 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/random.h +283 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/scheduler.cpp +175 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/scheduler.h +117 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/small_vector.h +540 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/stream.cpp +109 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/stream.h +62 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/threadpool.h +133 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/transforms.cpp +1115 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/transforms.h +231 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/transforms_impl.h +109 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/types/bf16.h +188 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/types/complex.h +131 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/types/fp16.h +235 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/types/half_types.h +68 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/types/limits.h +76 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/utils.cpp +358 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/utils.h +242 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/version.cpp +11 -0
- mlx_rocm-0.1.2/vendor/mlx-rocm-upstream/mlx/version.h +22 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# mlx-rocm MVP — standalone CMake.
|
|
2
|
+
#
|
|
3
|
+
# Host-only build (e.g. host-a, no ROCm):
|
|
4
|
+
# cmake -S . -B build && cmake --build build
|
|
5
|
+
# ./build/gemm_smoke host
|
|
6
|
+
#
|
|
7
|
+
# ROCm build (e.g. guest-a, RX 9070 XT / gfx1201):
|
|
8
|
+
# cmake -S . -B build -DMLX_ROCM_WITH_HIP=ON && cmake --build build
|
|
9
|
+
# ./build/gemm_smoke hip
|
|
10
|
+
#
|
|
11
|
+
# MLX_ROCM_WITH_HIP: AUTO (default) | ON | OFF.
|
|
12
|
+
|
|
13
|
+
cmake_minimum_required(VERSION 3.20)
|
|
14
|
+
project(mlx_rocm LANGUAGES CXX)
|
|
15
|
+
|
|
16
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
17
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
18
|
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
19
|
+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
|
20
|
+
endif()
|
|
21
|
+
|
|
22
|
+
# ----------------------------- ROCm detection ------------------------------
|
|
23
|
+
# Manual find_path/find_library (distro-agnostic: Fedora/TheRock ship the
|
|
24
|
+
# hip CMake configs in non-standard places; the libs are always plain .so).
|
|
25
|
+
if(NOT DEFINED MLX_ROCM_WITH_HIP)
|
|
26
|
+
set(MLX_ROCM_WITH_HIP AUTO)
|
|
27
|
+
endif()
|
|
28
|
+
|
|
29
|
+
find_path(MLX_ROCM_HIP_INCLUDE_DIR
|
|
30
|
+
NAMES hip/hip_runtime.h
|
|
31
|
+
PATHS /usr/include /opt/rocm/include /opt/rocm/hip/include)
|
|
32
|
+
find_path(MLX_ROCM_HIPBLASLT_INCLUDE_DIR
|
|
33
|
+
NAMES hipblaslt/hipblaslt.h
|
|
34
|
+
PATHS /usr/include /opt/rocm/include)
|
|
35
|
+
find_library(MLX_ROCM_HIP_LIBRARY NAMES amdhip64
|
|
36
|
+
PATHS /usr/lib64 /usr/lib/x86_64-linux-gnu /opt/rocm/lib)
|
|
37
|
+
find_library(MLX_ROCM_HIPBLASLT_LIBRARY NAMES hipblaslt
|
|
38
|
+
PATHS /usr/lib64 /usr/lib/x86_64-linux-gnu /opt/rocm/lib)
|
|
39
|
+
|
|
40
|
+
set(MLX_ROCM_HAVE_HIP FALSE)
|
|
41
|
+
if(MLX_ROCM_HIP_INCLUDE_DIR AND MLX_ROCM_HIPBLASLT_INCLUDE_DIR
|
|
42
|
+
AND MLX_ROCM_HIP_LIBRARY AND MLX_ROCM_HIPBLASLT_LIBRARY)
|
|
43
|
+
set(MLX_ROCM_HAVE_HIP TRUE)
|
|
44
|
+
endif()
|
|
45
|
+
|
|
46
|
+
string(TOUPPER "${MLX_ROCM_WITH_HIP}" MLX_ROCM_WITH_HIP_U)
|
|
47
|
+
|
|
48
|
+
if(MLX_ROCM_WITH_HIP_U STREQUAL "AUTO")
|
|
49
|
+
set(MLX_ROCM_WITH_HIP "${MLX_ROCM_HAVE_HIP}")
|
|
50
|
+
endif()
|
|
51
|
+
|
|
52
|
+
set(MLX_ROCM_HIP_BUILT FALSE)
|
|
53
|
+
if(MLX_ROCM_WITH_HIP)
|
|
54
|
+
if(NOT MLX_ROCM_HAVE_HIP)
|
|
55
|
+
message(FATAL_ERROR
|
|
56
|
+
"MLX_ROCM_WITH_HIP=ON but hip/hipBLASLt were not found "
|
|
57
|
+
"(looked for hip/hip_runtime.h, hipblaslt/hipblaslt.h, "
|
|
58
|
+
"libamdhip64, libhipblaslt).")
|
|
59
|
+
endif()
|
|
60
|
+
set(MLX_ROCM_HIP_BUILT TRUE)
|
|
61
|
+
endif()
|
|
62
|
+
|
|
63
|
+
message(STATUS "mlx-rocm: WITH_HIP=${MLX_ROCM_WITH_HIP} (found ROCm: ${MLX_ROCM_HAVE_HIP})")
|
|
64
|
+
|
|
65
|
+
# ------------------------------- targets ------------------------------------
|
|
66
|
+
add_library(mlx_rocm SHARED src/cpp/mlx_rocm/gemm/hipblaslt.cpp)
|
|
67
|
+
target_include_directories(mlx_rocm PUBLIC src/cpp)
|
|
68
|
+
set_target_properties(mlx_rocm PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
69
|
+
|
|
70
|
+
if(MLX_ROCM_HIP_BUILT)
|
|
71
|
+
target_compile_definitions(mlx_rocm PUBLIC MLX_ROCM_WITH_HIP=1)
|
|
72
|
+
# host-compiler (g++) build of the HIP headers; hipcc defines this itself.
|
|
73
|
+
target_compile_definitions(mlx_rocm PRIVATE __HIP_PLATFORM_AMD__=1)
|
|
74
|
+
target_include_directories(mlx_rocm SYSTEM PRIVATE
|
|
75
|
+
${MLX_ROCM_HIP_INCLUDE_DIR}
|
|
76
|
+
${MLX_ROCM_HIPBLASLT_INCLUDE_DIR})
|
|
77
|
+
target_link_libraries(mlx_rocm PRIVATE
|
|
78
|
+
${MLX_ROCM_HIP_LIBRARY}
|
|
79
|
+
${MLX_ROCM_HIPBLASLT_LIBRARY})
|
|
80
|
+
endif()
|
|
81
|
+
|
|
82
|
+
add_executable(gemm_smoke examples/gemm_smoke.cpp)
|
|
83
|
+
target_link_libraries(gemm_smoke PRIVATE mlx_rocm)
|
|
84
|
+
if(MLX_ROCM_HIP_BUILT)
|
|
85
|
+
target_compile_definitions(gemm_smoke PRIVATE MLX_ROCM_GEMM_HIP_BUILT=1)
|
|
86
|
+
endif()
|
|
87
|
+
|
|
88
|
+
if(MLX_ROCM_HIP_BUILT)
|
|
89
|
+
# Copy the lib next to the driver so the smoke run and the python ctypes
|
|
90
|
+
# loader can find it without LD_LIBRARY_PATH acrobatics.
|
|
91
|
+
add_custom_command(TARGET mlx_rocm POST_BUILD
|
|
92
|
+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:mlx_rocm>
|
|
93
|
+
${CMAKE_BINARY_DIR}/libmlx_rocm.so)
|
|
94
|
+
endif()
|
mlx_rocm-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2023 Apple Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
mlx_rocm-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mlx-rocm
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: ROCm backend for MLX (pre-alpha): vendored mlx ROCm backend tree + hipBLASLt GEMM + QMV decode kernels, validated on AMD RDNA4 (gfx1201)
|
|
5
|
+
Author-email: Submitter <submitter@example.org>
|
|
6
|
+
Keywords: mlx,rocm,hip,amd,rdna4,gfx1201
|
|
7
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# mlx-rocm
|
|
17
|
+
|
|
18
|
+
ROCm backend for [MLX](https://github.com/ml-explore/mlx) — **pre-alpha**
|
|
19
|
+
(first public release 0.1.0).
|
|
20
|
+
|
|
21
|
+
Purpose: a ROCm backend for MLX on AMD RDNA4 — validated on the RX 9070 XT
|
|
22
|
+
(**gfx1201** — *not* gfx110x) — targeting the 122B hybrid at high decode
|
|
23
|
+
speed. MTP spec decode and KV management are part of the MLX core path;
|
|
24
|
+
serving is out of scope for this repo.
|
|
25
|
+
|
|
26
|
+
Stage: **pre-alpha**. 0.1.0 is a public milestone of the current tree, not a
|
|
27
|
+
stability promise — expect breaking changes. The **alpha cut is planned once
|
|
28
|
+
decode reaches close to the card's ceiling** (122B-hybrid target: ~120 tok/s,
|
|
29
|
+
byte-identical vs autoregressive).
|
|
30
|
+
|
|
31
|
+
Verified toolchain: ROCm 10.1 userland on the validated guest (core at
|
|
32
|
+
`/opt/rocm/core-10.1`; 6.4 was the early probe validation and 7.7 the original
|
|
33
|
+
target — neither is the verified version).
|
|
34
|
+
|
|
35
|
+
## What this is
|
|
36
|
+
|
|
37
|
+
Three pieces:
|
|
38
|
+
|
|
39
|
+
1. **`vendor/mlx-rocm-upstream/`** — the vendored ROCm backend tree: a
|
|
40
|
+
complete `mlx/backend/rocm/` mirroring the CUDA backend file-for-file
|
|
41
|
+
(GatedDeltaUpdate fallback, mxfp8 prefill GEMM, gfx1200/RDNA4 fixes).
|
|
42
|
+
MIT licensed (`LICENSE.upstream`).
|
|
43
|
+
2. **`src/cpp/mlx_rocm/gemm/`** — a minimal standalone hipBLASLt GEMM
|
|
44
|
+
(bf16 + fp8 e4m3, persistent handle + workspace, heuristic algo,
|
|
45
|
+
row-major layouts) plus a dependency-free CPU reference GEMM.
|
|
46
|
+
Modeled on the fork's `gemms/hipblaslt_gemm.cpp`.
|
|
47
|
+
3. **`scripts/smoke.sh`** — builds the GEMM, runs a small GEMM on the
|
|
48
|
+
build host (host-a, CPU reference), then rsyncs the tree to
|
|
49
|
+
guest-a (`ssh operator@<tailnet-ip>`), builds it against local
|
|
50
|
+
ROCm, and runs the GPU GEMM + fp8 probe there (guest-a phase budgeted
|
|
51
|
+
~120 s; failures are recorded, not fatal).
|
|
52
|
+
|
|
53
|
+
## gfx1201 notes
|
|
54
|
+
|
|
55
|
+
- **RX 9070 XT = `gfx1201`** (RDNA4). `gfx110x` is RDNA3 (RX 7000). The
|
|
56
|
+
fork's default arch list includes gfx1200/gfx1201; the RDNA4 tier gets
|
|
57
|
+
its own QMV/QMM crossover tuning and the WMMA dense-qmm allowlist.
|
|
58
|
+
- **fp8 GEMM status on this box**: the smoke's
|
|
59
|
+
`mlx_rocm_gemm_fp8_probe()` (256³ e4m3 GEMM vs. host reference)
|
|
60
|
+
**passes** on guest-a gfx1201 (max_rel_err 0.0057, 0/65536 bad) — the
|
|
61
|
+
probe shows no driver bug. Upstream notes fp8 e4m3 activation GEMM
|
|
62
|
+
"may be kernel-buggy on some RDNA4 drivers — long-context prefill on
|
|
63
|
+
gfx1201 garbles" (run-386 evidence, a different workload than this
|
|
64
|
+
probe). Keep `MLX_ROCM_GEMM_BF16=1` as the safe default until real
|
|
65
|
+
prefill validation proves the driver clean for that workload. The
|
|
66
|
+
probe is part of the smoke run.
|
|
67
|
+
- Discrete-GPU allocator hazards the fork engineered around (BAR read
|
|
68
|
+
~54 MB/s vs hipMemcpy 50.4 GB/s → pinned `host_stage` bounce;
|
|
69
|
+
async-pool off by default) are inherited from the vendored tree.
|
|
70
|
+
|
|
71
|
+
## Build
|
|
72
|
+
|
|
73
|
+
Host-only (no ROCm needed — CPU reference path):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
cmake -S . -B build && cmake --build build
|
|
77
|
+
./build/gemm_smoke host
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
With ROCm (gfx1201 box, e.g. the guest-a guest — see `docs/quickstart.md`):
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
cmake -S . -B build -DMLX_ROCM_WITH_HIP=ON -DCMAKE_PREFIX_PATH=/opt/rocm/core-10.1 \
|
|
84
|
+
&& cmake --build build
|
|
85
|
+
./build/gemm_smoke hip # bf16 512^3 + fp8 e4m3 probe
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Full `mlx` wheel from the vendored tree (next phase):
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
CMAKE_ARGS="-DMLX_BUILD_ROCM=ON -DCMAKE_HIP_ARCHITECTURES=gfx1201 -DBLA_VENDOR=OpenBLAS -DCMAKE_PREFIX_PATH=/opt/rocm/core-10.1" \
|
|
92
|
+
python setup.py bdist_wheel # from vendor/mlx-rocm-upstream layout
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Smoke
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
scripts/smoke.sh
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Local: build + small host GEMM. Guest-a: `ssh` reachability + `rocm-smi`
|
|
102
|
+
check, tar transfer, ROCm build, GPU GEMM + fp8 probe. Results land in
|
|
103
|
+
`scripts/smoke-results/` (gitignored).
|
|
104
|
+
|
|
105
|
+
## Supported models (gfx1201, ROCm 10.1 guest)
|
|
106
|
+
|
|
107
|
+
| Model | Quant | Status on gfx1201 |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| Qwen3-0.6B | 8-bit (affine) | validated — benched 207.6–214.3 tok/s (`k2-non-gemm-fusion`) |
|
|
110
|
+
| Qwen3-0.6B | bf16 | Phase 0 smoke target (`scripts/smoke.py` ladder) |
|
|
111
|
+
| 9B-class dense Qwen3 | 4-bit (affine qmm) | validated — benched 55.9–57.8 tok/s A/B (`k2-non-gemm-fusion`), 63.8 tok/s with a 16-token warmup (`opt-gauntlet-areaA`) |
|
|
112
|
+
| 122B hybrid (GDN + FA) | 4-bit (affine) | supported — the main workload; ~73 tok/s AR small-ctx on main, levers in flight toward ~120 |
|
|
113
|
+
| 27B dense / MoE | — | not validated (a 27B load was in flight on the guest, unvalidated) |
|
|
114
|
+
| MTP spec decode | 4-bit | K=2 supported, lossless (merged); slower than AR today — the active speed target |
|
|
115
|
+
| non-gfx1201 archs | — | not validated (only gfx1201 is validated in this repo) |
|
|
116
|
+
|
|
117
|
+
Details, in-flight items, and caveats: `docs/limitations.md`.
|
|
118
|
+
|
|
119
|
+
## Converting a model
|
|
120
|
+
|
|
121
|
+
`mlx_lm` (≥ 0.32) converts a HuggingFace ref to the safetensors layout the
|
|
122
|
+
loader expects:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
# bf16
|
|
126
|
+
mlx_lm.convert --model Qwen/Qwen3-0.6B
|
|
127
|
+
# 4-bit affine qmm (validated on gfx1201)
|
|
128
|
+
mlx_lm.convert --model Qwen/Qwen3-8B --quantize --bits 4 --group-size 64
|
|
129
|
+
# 8-bit (AWQ-style)
|
|
130
|
+
mlx_lm.convert --model Qwen/Qwen3-8B --quantize --bits 8 --q-mode awq
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Or use a pre-converted `mlx-community/*` ref (e.g.
|
|
134
|
+
`mlx-community/Qwen3-0.6B-8bit`). **mxfp4 is the in-flight target (K4)**:
|
|
135
|
+
prefill runs via the opt-in dequant→bf16 GEMM path today; there is no native
|
|
136
|
+
mxfp4 kernel yet.
|
|
137
|
+
|
|
138
|
+
## Status — lanes
|
|
139
|
+
|
|
140
|
+
| Lane | What | Branch |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| K1 (QMV/GEMV bandwidth) | int8-activation QMV fix (N=12288); no bench yet | `k1-qmv-gemv-bandwidth` |
|
|
143
|
+
| K2 (non-GEMM fusion) | merged (#2) | — |
|
|
144
|
+
| K3 (GDN port) | merged (#3) | — |
|
|
145
|
+
| K4 (MXFP4) | opt-in dequant→bf16 GEMM only; no native kernel, no dedicated branch yet | — |
|
|
146
|
+
| G1 (graph decode) | pilot wiring + ROCm 10.1 `hipStreamIsCapturing` fix; symbol export / engine wiring pending | `g1-graph-decode` |
|
|
147
|
+
| alpha (docs/housekeeping) | alpha-state checklist + this docs wave | `alpha-checklist` / `alpha-docs` |
|
|
148
|
+
|
|
149
|
+
## Python package
|
|
150
|
+
|
|
151
|
+
`pip install mlx-rocm` (`pyproject.toml`, `src/python/mlx_rocm/`): ctypes
|
|
152
|
+
bindings to `libmlx_rocm.so` (host GEMM always; GPU GEMM + fp8 probe in ROCm
|
|
153
|
+
builds) with a pure-numpy bf16 fallback. The published 0.1.0 wheel is this
|
|
154
|
+
package; the full `mlx` wheel (the vendored tree with the ROCm backend,
|
|
155
|
+
`scripts/build-wheel.sh`) is built and validated per workload — the 9B-class
|
|
156
|
+
and 122B-hybrid serve paths are validated on the guest.
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
MIT (MLX upstream license; see `LICENSE`).
|
|
161
|
+
|
|
162
|
+
## Repo layout (scaffold)
|
|
163
|
+
|
|
164
|
+
- `docs/plan.md` — the research report + phased plan (architecture, CUDA→ROCm map,
|
|
165
|
+
prior art, gfx1201 findings, effort).
|
|
166
|
+
- `docs/limitations.md` — what works / in flight / not supported / caveats.
|
|
167
|
+
- `docs/quickstart.md` — the verified build + smoke path on a gfx1201 box.
|
|
168
|
+
- `PLAN.md` — living plan (phases, current state, open questions).
|
|
169
|
+
- `vendor.json` — the pinned vendor fork + ref (primary/fallback) and the build flags.
|
|
170
|
+
- `scripts/build-wheel.sh` — build the `mlx` wheel with `-DMLX_BUILD_ROCM=ON` for gfx1201 (runs on guest-a).
|
|
171
|
+
- `scripts/smoke.py` — Phase 0 smoke: is_available, matmul/softmax numerics, 0.6B generate.
|
|
172
|
+
- `scripts/smoke-serve.sh` — Phase 1 smoke: qmlx-serve with a 9B-class dense Qwen3.
|
|
173
|
+
- `scripts/size_ratchet.py` + `size-ratchet.json` — deterministic size gate (CI).
|
|
174
|
+
- `tests/` — hermetic tests (CI) + `@pytest.mark.gpu` tests (guest-a only).
|
|
175
|
+
|
|
176
|
+
## Commands
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
uv sync
|
|
180
|
+
uv run ruff format . && uv run ruff check .
|
|
181
|
+
uv run pytest -m "not gpu" # hermetic (CI)
|
|
182
|
+
uv run python scripts/size_ratchet.py --base HEAD
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
GPU commands run on guest-a (see AGENTS.md).
|
|
186
|
+
|
|
187
|
+
## Rules
|
|
188
|
+
|
|
189
|
+
Branch + PR to main (protected: no direct pushes), CI green, adversarial review by a
|
|
190
|
+
different agent than the submitter, peer merges `--squash`. See AGENTS.md.
|
mlx_rocm-0.1.2/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# mlx-rocm
|
|
2
|
+
|
|
3
|
+
ROCm backend for [MLX](https://github.com/ml-explore/mlx) — **pre-alpha**
|
|
4
|
+
(first public release 0.1.0).
|
|
5
|
+
|
|
6
|
+
Purpose: a ROCm backend for MLX on AMD RDNA4 — validated on the RX 9070 XT
|
|
7
|
+
(**gfx1201** — *not* gfx110x) — targeting the 122B hybrid at high decode
|
|
8
|
+
speed. MTP spec decode and KV management are part of the MLX core path;
|
|
9
|
+
serving is out of scope for this repo.
|
|
10
|
+
|
|
11
|
+
Stage: **pre-alpha**. 0.1.0 is a public milestone of the current tree, not a
|
|
12
|
+
stability promise — expect breaking changes. The **alpha cut is planned once
|
|
13
|
+
decode reaches close to the card's ceiling** (122B-hybrid target: ~120 tok/s,
|
|
14
|
+
byte-identical vs autoregressive).
|
|
15
|
+
|
|
16
|
+
Verified toolchain: ROCm 10.1 userland on the validated guest (core at
|
|
17
|
+
`/opt/rocm/core-10.1`; 6.4 was the early probe validation and 7.7 the original
|
|
18
|
+
target — neither is the verified version).
|
|
19
|
+
|
|
20
|
+
## What this is
|
|
21
|
+
|
|
22
|
+
Three pieces:
|
|
23
|
+
|
|
24
|
+
1. **`vendor/mlx-rocm-upstream/`** — the vendored ROCm backend tree: a
|
|
25
|
+
complete `mlx/backend/rocm/` mirroring the CUDA backend file-for-file
|
|
26
|
+
(GatedDeltaUpdate fallback, mxfp8 prefill GEMM, gfx1200/RDNA4 fixes).
|
|
27
|
+
MIT licensed (`LICENSE.upstream`).
|
|
28
|
+
2. **`src/cpp/mlx_rocm/gemm/`** — a minimal standalone hipBLASLt GEMM
|
|
29
|
+
(bf16 + fp8 e4m3, persistent handle + workspace, heuristic algo,
|
|
30
|
+
row-major layouts) plus a dependency-free CPU reference GEMM.
|
|
31
|
+
Modeled on the fork's `gemms/hipblaslt_gemm.cpp`.
|
|
32
|
+
3. **`scripts/smoke.sh`** — builds the GEMM, runs a small GEMM on the
|
|
33
|
+
build host (host-a, CPU reference), then rsyncs the tree to
|
|
34
|
+
guest-a (`ssh operator@<tailnet-ip>`), builds it against local
|
|
35
|
+
ROCm, and runs the GPU GEMM + fp8 probe there (guest-a phase budgeted
|
|
36
|
+
~120 s; failures are recorded, not fatal).
|
|
37
|
+
|
|
38
|
+
## gfx1201 notes
|
|
39
|
+
|
|
40
|
+
- **RX 9070 XT = `gfx1201`** (RDNA4). `gfx110x` is RDNA3 (RX 7000). The
|
|
41
|
+
fork's default arch list includes gfx1200/gfx1201; the RDNA4 tier gets
|
|
42
|
+
its own QMV/QMM crossover tuning and the WMMA dense-qmm allowlist.
|
|
43
|
+
- **fp8 GEMM status on this box**: the smoke's
|
|
44
|
+
`mlx_rocm_gemm_fp8_probe()` (256³ e4m3 GEMM vs. host reference)
|
|
45
|
+
**passes** on guest-a gfx1201 (max_rel_err 0.0057, 0/65536 bad) — the
|
|
46
|
+
probe shows no driver bug. Upstream notes fp8 e4m3 activation GEMM
|
|
47
|
+
"may be kernel-buggy on some RDNA4 drivers — long-context prefill on
|
|
48
|
+
gfx1201 garbles" (run-386 evidence, a different workload than this
|
|
49
|
+
probe). Keep `MLX_ROCM_GEMM_BF16=1` as the safe default until real
|
|
50
|
+
prefill validation proves the driver clean for that workload. The
|
|
51
|
+
probe is part of the smoke run.
|
|
52
|
+
- Discrete-GPU allocator hazards the fork engineered around (BAR read
|
|
53
|
+
~54 MB/s vs hipMemcpy 50.4 GB/s → pinned `host_stage` bounce;
|
|
54
|
+
async-pool off by default) are inherited from the vendored tree.
|
|
55
|
+
|
|
56
|
+
## Build
|
|
57
|
+
|
|
58
|
+
Host-only (no ROCm needed — CPU reference path):
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
cmake -S . -B build && cmake --build build
|
|
62
|
+
./build/gemm_smoke host
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
With ROCm (gfx1201 box, e.g. the guest-a guest — see `docs/quickstart.md`):
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
cmake -S . -B build -DMLX_ROCM_WITH_HIP=ON -DCMAKE_PREFIX_PATH=/opt/rocm/core-10.1 \
|
|
69
|
+
&& cmake --build build
|
|
70
|
+
./build/gemm_smoke hip # bf16 512^3 + fp8 e4m3 probe
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Full `mlx` wheel from the vendored tree (next phase):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
CMAKE_ARGS="-DMLX_BUILD_ROCM=ON -DCMAKE_HIP_ARCHITECTURES=gfx1201 -DBLA_VENDOR=OpenBLAS -DCMAKE_PREFIX_PATH=/opt/rocm/core-10.1" \
|
|
77
|
+
python setup.py bdist_wheel # from vendor/mlx-rocm-upstream layout
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Smoke
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
scripts/smoke.sh
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Local: build + small host GEMM. Guest-a: `ssh` reachability + `rocm-smi`
|
|
87
|
+
check, tar transfer, ROCm build, GPU GEMM + fp8 probe. Results land in
|
|
88
|
+
`scripts/smoke-results/` (gitignored).
|
|
89
|
+
|
|
90
|
+
## Supported models (gfx1201, ROCm 10.1 guest)
|
|
91
|
+
|
|
92
|
+
| Model | Quant | Status on gfx1201 |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| Qwen3-0.6B | 8-bit (affine) | validated — benched 207.6–214.3 tok/s (`k2-non-gemm-fusion`) |
|
|
95
|
+
| Qwen3-0.6B | bf16 | Phase 0 smoke target (`scripts/smoke.py` ladder) |
|
|
96
|
+
| 9B-class dense Qwen3 | 4-bit (affine qmm) | validated — benched 55.9–57.8 tok/s A/B (`k2-non-gemm-fusion`), 63.8 tok/s with a 16-token warmup (`opt-gauntlet-areaA`) |
|
|
97
|
+
| 122B hybrid (GDN + FA) | 4-bit (affine) | supported — the main workload; ~73 tok/s AR small-ctx on main, levers in flight toward ~120 |
|
|
98
|
+
| 27B dense / MoE | — | not validated (a 27B load was in flight on the guest, unvalidated) |
|
|
99
|
+
| MTP spec decode | 4-bit | K=2 supported, lossless (merged); slower than AR today — the active speed target |
|
|
100
|
+
| non-gfx1201 archs | — | not validated (only gfx1201 is validated in this repo) |
|
|
101
|
+
|
|
102
|
+
Details, in-flight items, and caveats: `docs/limitations.md`.
|
|
103
|
+
|
|
104
|
+
## Converting a model
|
|
105
|
+
|
|
106
|
+
`mlx_lm` (≥ 0.32) converts a HuggingFace ref to the safetensors layout the
|
|
107
|
+
loader expects:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
# bf16
|
|
111
|
+
mlx_lm.convert --model Qwen/Qwen3-0.6B
|
|
112
|
+
# 4-bit affine qmm (validated on gfx1201)
|
|
113
|
+
mlx_lm.convert --model Qwen/Qwen3-8B --quantize --bits 4 --group-size 64
|
|
114
|
+
# 8-bit (AWQ-style)
|
|
115
|
+
mlx_lm.convert --model Qwen/Qwen3-8B --quantize --bits 8 --q-mode awq
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Or use a pre-converted `mlx-community/*` ref (e.g.
|
|
119
|
+
`mlx-community/Qwen3-0.6B-8bit`). **mxfp4 is the in-flight target (K4)**:
|
|
120
|
+
prefill runs via the opt-in dequant→bf16 GEMM path today; there is no native
|
|
121
|
+
mxfp4 kernel yet.
|
|
122
|
+
|
|
123
|
+
## Status — lanes
|
|
124
|
+
|
|
125
|
+
| Lane | What | Branch |
|
|
126
|
+
|---|---|---|
|
|
127
|
+
| K1 (QMV/GEMV bandwidth) | int8-activation QMV fix (N=12288); no bench yet | `k1-qmv-gemv-bandwidth` |
|
|
128
|
+
| K2 (non-GEMM fusion) | merged (#2) | — |
|
|
129
|
+
| K3 (GDN port) | merged (#3) | — |
|
|
130
|
+
| K4 (MXFP4) | opt-in dequant→bf16 GEMM only; no native kernel, no dedicated branch yet | — |
|
|
131
|
+
| G1 (graph decode) | pilot wiring + ROCm 10.1 `hipStreamIsCapturing` fix; symbol export / engine wiring pending | `g1-graph-decode` |
|
|
132
|
+
| alpha (docs/housekeeping) | alpha-state checklist + this docs wave | `alpha-checklist` / `alpha-docs` |
|
|
133
|
+
|
|
134
|
+
## Python package
|
|
135
|
+
|
|
136
|
+
`pip install mlx-rocm` (`pyproject.toml`, `src/python/mlx_rocm/`): ctypes
|
|
137
|
+
bindings to `libmlx_rocm.so` (host GEMM always; GPU GEMM + fp8 probe in ROCm
|
|
138
|
+
builds) with a pure-numpy bf16 fallback. The published 0.1.0 wheel is this
|
|
139
|
+
package; the full `mlx` wheel (the vendored tree with the ROCm backend,
|
|
140
|
+
`scripts/build-wheel.sh`) is built and validated per workload — the 9B-class
|
|
141
|
+
and 122B-hybrid serve paths are validated on the guest.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT (MLX upstream license; see `LICENSE`).
|
|
146
|
+
|
|
147
|
+
## Repo layout (scaffold)
|
|
148
|
+
|
|
149
|
+
- `docs/plan.md` — the research report + phased plan (architecture, CUDA→ROCm map,
|
|
150
|
+
prior art, gfx1201 findings, effort).
|
|
151
|
+
- `docs/limitations.md` — what works / in flight / not supported / caveats.
|
|
152
|
+
- `docs/quickstart.md` — the verified build + smoke path on a gfx1201 box.
|
|
153
|
+
- `PLAN.md` — living plan (phases, current state, open questions).
|
|
154
|
+
- `vendor.json` — the pinned vendor fork + ref (primary/fallback) and the build flags.
|
|
155
|
+
- `scripts/build-wheel.sh` — build the `mlx` wheel with `-DMLX_BUILD_ROCM=ON` for gfx1201 (runs on guest-a).
|
|
156
|
+
- `scripts/smoke.py` — Phase 0 smoke: is_available, matmul/softmax numerics, 0.6B generate.
|
|
157
|
+
- `scripts/smoke-serve.sh` — Phase 1 smoke: qmlx-serve with a 9B-class dense Qwen3.
|
|
158
|
+
- `scripts/size_ratchet.py` + `size-ratchet.json` — deterministic size gate (CI).
|
|
159
|
+
- `tests/` — hermetic tests (CI) + `@pytest.mark.gpu` tests (guest-a only).
|
|
160
|
+
|
|
161
|
+
## Commands
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
uv sync
|
|
165
|
+
uv run ruff format . && uv run ruff check .
|
|
166
|
+
uv run pytest -m "not gpu" # hermetic (CI)
|
|
167
|
+
uv run python scripts/size_ratchet.py --base HEAD
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
GPU commands run on guest-a (see AGENTS.md).
|
|
171
|
+
|
|
172
|
+
## Rules
|
|
173
|
+
|
|
174
|
+
Branch + PR to main (protected: no direct pushes), CI green, adversarial review by a
|
|
175
|
+
different agent than the submitter, peer merges `--squash`. See AGENTS.md.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// mlx-rocm MVP — GEMM smoke driver.
|
|
2
|
+
//
|
|
3
|
+
// Usage: gemm_smoke [host] [hip]
|
|
4
|
+
// host — small bf16 GEMM on CPU (library host path vs. independent f32
|
|
5
|
+
// scalar reference in this file)
|
|
6
|
+
// hip — bf16 GPU GEMM on device 0 + fp8 e4m3 self-test (needs a build
|
|
7
|
+
// with MLX_ROCM_WITH_HIP and a visible AMD GPU)
|
|
8
|
+
// No arguments: runs every section the build supports.
|
|
9
|
+
// Exit code: 0 = all sections pass, 1 = any section failed.
|
|
10
|
+
|
|
11
|
+
#include "mlx_rocm/gemm/gemm.h"
|
|
12
|
+
#include "mlx_rocm/gemm/gemm_ref.h"
|
|
13
|
+
|
|
14
|
+
#include <chrono>
|
|
15
|
+
#include <cstdio>
|
|
16
|
+
#include <cstdlib>
|
|
17
|
+
#include <cstring>
|
|
18
|
+
#include <vector>
|
|
19
|
+
|
|
20
|
+
using mlx_rocm::gemm_ref::bf16_to_f32;
|
|
21
|
+
using mlx_rocm::gemm_ref::f32_to_bf16;
|
|
22
|
+
using mlx_rocm::gemm_ref::lcg_f32;
|
|
23
|
+
|
|
24
|
+
static int g_fail = 0;
|
|
25
|
+
|
|
26
|
+
#define CHECK(cond, msg) \
|
|
27
|
+
do { \
|
|
28
|
+
if (!(cond)) { \
|
|
29
|
+
std::fprintf(stderr, "FAIL: %s\n", msg); \
|
|
30
|
+
g_fail = 1; \
|
|
31
|
+
return 1; \
|
|
32
|
+
} \
|
|
33
|
+
} while (0)
|
|
34
|
+
|
|
35
|
+
// Independent scalar reference: f32 accumulation, k-major loop order
|
|
36
|
+
// (different order than the library's i-j-k reference).
|
|
37
|
+
static void ref_scalar(const std::uint16_t *A, const std::uint16_t *B,
|
|
38
|
+
std::uint16_t *D, int m, int n, int k) {
|
|
39
|
+
for (int i = 0; i < m; ++i)
|
|
40
|
+
for (int j = 0; j < n; ++j) {
|
|
41
|
+
float acc = 0.0f;
|
|
42
|
+
for (int l = 0; l < k; ++l)
|
|
43
|
+
acc += bf16_to_f32(A[(std::int64_t)i * k + l]) *
|
|
44
|
+
bf16_to_f32(B[(std::int64_t)l * n + j]);
|
|
45
|
+
D[(std::int64_t)i * n + j] = f32_to_bf16(acc);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static std::uint16_t fill_bf16(std::vector<std::uint16_t> &v, std::uint64_t &seed) {
|
|
50
|
+
for (auto &x : v)
|
|
51
|
+
x = f32_to_bf16(lcg_f32(seed));
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// bf16 has ~2^-8 relative resolution; allow 4 ulp-ish slack for the
|
|
56
|
+
// f32 accumulation-order difference.
|
|
57
|
+
static int cmp_bf16(const std::uint16_t *a, const std::uint16_t *b, size_t n,
|
|
58
|
+
float tol_rel) {
|
|
59
|
+
float max_rel = 0.f;
|
|
60
|
+
size_t bad = 0;
|
|
61
|
+
for (size_t i = 0; i < n; ++i) {
|
|
62
|
+
float x = bf16_to_f32(a[i]);
|
|
63
|
+
float y = bf16_to_f32(b[i]);
|
|
64
|
+
float denom = x > 0.f ? x : -x;
|
|
65
|
+
if (denom < 1e-3f)
|
|
66
|
+
denom = 1e-3f;
|
|
67
|
+
float rel = (y - x > 0.f ? y - x : x - y) / denom;
|
|
68
|
+
if (rel > max_rel)
|
|
69
|
+
max_rel = rel;
|
|
70
|
+
if (rel > tol_rel)
|
|
71
|
+
++bad;
|
|
72
|
+
}
|
|
73
|
+
std::fprintf(stderr, " cmp: max_rel_err=%.5f bad=%zu/%zu\n", max_rel, bad,
|
|
74
|
+
n);
|
|
75
|
+
return bad == 0 ? 0 : 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static int run_host(int do_host) {
|
|
79
|
+
if (!do_host)
|
|
80
|
+
return 0;
|
|
81
|
+
std::fprintf(stderr, "== host section (bf16, 256^3) ==\n");
|
|
82
|
+
const int m = 256, n = 256, k = 256;
|
|
83
|
+
std::vector<std::uint16_t> A((size_t)m * k), B((size_t)k * n), D_lib((size_t)m * n),
|
|
84
|
+
D_ref((size_t)m * n);
|
|
85
|
+
std::uint64_t seed = 0x1234;
|
|
86
|
+
fill_bf16(A, seed);
|
|
87
|
+
fill_bf16(B, seed);
|
|
88
|
+
|
|
89
|
+
CHECK(mlx_rocm_gemm_host_bf16(A.data(), B.data(), D_lib.data(), m, n, k) == 0,
|
|
90
|
+
"mlx_rocm_gemm_host_bf16 returned error");
|
|
91
|
+
ref_scalar(A.data(), B.data(), D_ref.data(), m, n, k);
|
|
92
|
+
CHECK(cmp_bf16(D_lib.data(), D_ref.data(), (size_t)m * n, 2e-2f) == 0,
|
|
93
|
+
"host GEMM mismatch vs independent reference");
|
|
94
|
+
std::fprintf(stderr, "host GEMM: PASS\n");
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#ifdef MLX_ROCM_GEMM_HIP_BUILT
|
|
99
|
+
static int run_hip(int do_hip) {
|
|
100
|
+
if (!do_hip)
|
|
101
|
+
return 0;
|
|
102
|
+
std::fprintf(stderr, "== hip section (bf16 512^3 + fp8 probe) ==\n");
|
|
103
|
+
|
|
104
|
+
char info[256];
|
|
105
|
+
if (mlx_rocm_backend_info(info, sizeof(info)) == 0)
|
|
106
|
+
std::fprintf(stderr, "backend: %s\n", info);
|
|
107
|
+
CHECK(mlx_rocm_hip_device_count() > 0, "no HIP device visible");
|
|
108
|
+
|
|
109
|
+
const int m = 512, n = 512, k = 512;
|
|
110
|
+
std::vector<std::uint16_t> A((size_t)m * k), B((size_t)k * n), D_gpu((size_t)m * n),
|
|
111
|
+
D_ref((size_t)m * n);
|
|
112
|
+
std::uint64_t seed = 0x5678;
|
|
113
|
+
fill_bf16(A, seed);
|
|
114
|
+
fill_bf16(B, seed);
|
|
115
|
+
ref_scalar(A.data(), B.data(), D_ref.data(), m, n, k);
|
|
116
|
+
|
|
117
|
+
auto t0 = std::chrono::steady_clock::now();
|
|
118
|
+
int rc = mlx_rocm_gemm_hip_bf16_hostio(A.data(), B.data(), D_gpu.data(), m, n,
|
|
119
|
+
k);
|
|
120
|
+
auto t1 = std::chrono::steady_clock::now();
|
|
121
|
+
CHECK(rc == 0, "mlx_rocm_gemm_hip_bf16_hostio failed");
|
|
122
|
+
double ms = std::chrono::duration<double, std::milli>(t1 - t0).count();
|
|
123
|
+
double tflops = 2.0 * m * n * k / ms / 1e9;
|
|
124
|
+
std::fprintf(stderr, " bf16 GEMM 512^3: %.1f ms (%.2f TFLOPS bf16)\n", ms,
|
|
125
|
+
tflops);
|
|
126
|
+
CHECK(cmp_bf16(D_gpu.data(), D_ref.data(), (size_t)m * n, 2e-2f) == 0,
|
|
127
|
+
"GPU GEMM mismatch vs host reference");
|
|
128
|
+
std::fprintf(stderr, "GPU bf16 GEMM: PASS\n");
|
|
129
|
+
|
|
130
|
+
std::fprintf(stderr, "preferred precision: %s (MLX_ROCM_GEMM_BF16=%s)\n",
|
|
131
|
+
mlx_rocm_preferred_precision(),
|
|
132
|
+
std::getenv("MLX_ROCM_GEMM_BF16") ? std::getenv("MLX_ROCM_GEMM_BF16")
|
|
133
|
+
: "(unset)");
|
|
134
|
+
if (mlx_rocm_gemm_fp8_probe() != 0)
|
|
135
|
+
std::fprintf(stderr,
|
|
136
|
+
"fp8 probe failed/unsupported on this driver — bf16 "
|
|
137
|
+
"fallback is the safe default (MLX_ROCM_GEMM_BF16=1)\n");
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
#else
|
|
141
|
+
static int run_hip(int do_hip) {
|
|
142
|
+
if (!do_hip)
|
|
143
|
+
return 0;
|
|
144
|
+
std::fprintf(stderr, "== hip section: skipped (host-only build) ==\n");
|
|
145
|
+
return 0;
|
|
146
|
+
}
|
|
147
|
+
#endif
|
|
148
|
+
|
|
149
|
+
int main(int argc, char **argv) {
|
|
150
|
+
int do_host = 0, do_hip = 0;
|
|
151
|
+
for (int i = 1; i < argc; ++i) {
|
|
152
|
+
if (std::strcmp(argv[i], "host") == 0)
|
|
153
|
+
do_host = 1;
|
|
154
|
+
else if (std::strcmp(argv[i], "hip") == 0)
|
|
155
|
+
do_hip = 1;
|
|
156
|
+
else {
|
|
157
|
+
std::fprintf(stderr, "usage: gemm_smoke [host] [hip]\n");
|
|
158
|
+
return 2;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!do_host && !do_hip)
|
|
162
|
+
do_host = do_hip = 1;
|
|
163
|
+
|
|
164
|
+
int rc = run_host(do_host) | run_hip(do_hip);
|
|
165
|
+
std::fprintf(stderr, "gemm_smoke: %s\n", g_fail ? "FAIL" : "PASS");
|
|
166
|
+
return g_fail ? 1 : rc;
|
|
167
|
+
}
|