Skip to content

Repository files navigation

Pretest Task MLX

System information

Hardware: Apple M1 Arm64, 8GB RAM
Operating System: macOS Sonoma 14.3
Kernel Version: Darwin 23.3.0

Framework execution

  1. Built and installed C++ API from source following the MLX documentation. Also installed the mlx binaries in Python from PyPI using

    pip install mlx

    mlxBuildLogs1
    mlxBuildLogs2

  2. Regression Example in MLX {C++ APIs}.

    Modified logistic and linear regression files in the mlx repository ( Calculated elapsed time).

    Steps to reproduce:

    Clone my fork and re-build the project or download the modified files (modified_linear_regression.cpp, modified_logistic_regression) and the CMakeLists.txt into the examples folder. Navigate to the examples folder.

    cd mlx/examples/cpp

    Rebuild the project in the root directory mlx using

    mkdir -p build && cd build
    cmake .. && make -j

    Navigate to the build directory:

    cd build/examples/cpp

    And execute the executables in the dir:

    ./tutorial
    modified_regression
  3. Speech recogntion using whisper in MLX {Python APIs}.

    Modified the following example to transcribe a 3.2Mb, 0.18-second audio file (harvard.wav) using the Whisper model by OpenAI with the MLX backend in 0.65 seconds.

    Steps to reproduce:
    Download transcribeScript.py and harvard.wav into the whisper directory created from following the example above.

    To run the script:

    python3 transcribeScript.py
    MLXWhisperSpeechRecognition

Section(2)

  1. Built WasmEdge with llama.cpp plugin by following this guide.

    wasmedge

  2. Execution(1) llama.cpp

    Followed this example to run "llama2 7b chat model in GGUF format" in WasmEdge

    llama

  3. Execution(2) API Server

    Chose "Mistral-7B-Instruct-v0.1" to run and created an OpenAI compatible API server for the model following this guide. Web UI:

    Screenshot 2024-02-17 at 6 03 54 PM

Troubleshooting

  1. If you updated your macOS and Xcode to Sonoma, yet the SDKs used during the build are of an older version, remove the CMake cache in the build dir and rebuild the project.
    rm CMakeCache.txt

About

Playing around with the mlx framework!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages