Cgml VS mlx

Compare Cgml vs mlx and see what are their differences.

Cgml

GPU-targeted vendor-agnostic AI library for Windows, and Mistral model implementation. (by Const-me)

mlx

MLX: An array framework for Apple silicon (by ml-explore)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
Cgml mlx
22 23
39 14,456
- 6.7%
8.6 9.8
4 months ago 1 day ago
C++ C++
GNU Lesser General Public License v3.0 only MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Cgml

Posts with mentions or reviews of Cgml. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-30.
  • Asynchronous Programming in C#
    9 projects | news.ycombinator.com | 30 Apr 2024
    > Meant no offense

    None taken.

    > computervison project in c#

    Yeah, for CV applications nuget.org is indeed not particularly great. Very few people are using C# for these things, people typically choose something else like Python and OpenCV.

    BTW, same applies to ML libraries, most folks are using Python/Torch/CUDA stack. For that hobby project https://github.com/Const-me/Cgml/ I had to re-implement the entire tech stack in C#/C++/HLSL.

  • Groq CEO: 'We No Longer Sell Hardware'
    2 projects | news.ycombinator.com | 7 Apr 2024
    > If there is a future with this idea, its gotta be just shipping the LLM with game right?

    That might be a nice application for this library of mine: https://github.com/Const-me/Cgml/

    That’s an open source Mistral ML model implementation which runs on GPUs (all of them, not just nVidia), takes 4.5GB on disk, uses under 6GB of VRAM, and optimized for interactive single-user use case. Probably fast enough for that application.

    You wouldn’t want in-game dialogues with the original model though. Game developers would need to finetune, retrain and/or do something else with these weights and/or my implementation.

  • Ask HN: How to get started with local language models?
    6 projects | news.ycombinator.com | 17 Mar 2024
    If you just want to run Mistral on Windows, you could try my port: https://github.com/Const-me/Cgml/tree/master/Mistral/Mistral...

    The setup is relatively easy: install .NET runtime, download 4.5 GB model file from BitTorrent, unpack a small ZIP file and run the EXE.

  • OpenAI postmortem – Unexpected responses from ChatGPT
    1 project | news.ycombinator.com | 22 Feb 2024
    Speaking about random sampling during inference, most ML models are doing it rather inefficiently.

    Here’s a better way: https://github.com/Const-me/Cgml/blob/master/Readme.md#rando...

    My HLSL is easily portable to CUDA, which has `__syncthreads` and `atomicInc` intrinsics.

  • Nvidia's Chat with RTX is a promising AI chatbot that runs locally on your PC
    7 projects | news.ycombinator.com | 13 Feb 2024
  • AMD Funded a Drop-In CUDA Implementation Built on ROCm: It's Open-Source
    23 projects | news.ycombinator.com | 12 Feb 2024
    I did a few times with Direct3D 11 compute shaders. Here’s an open-source example: https://github.com/Const-me/Cgml

    Pretty sure Vulkan gonna work equally well, at the very least there’s an open source DXVK project which implements D3D11 on top of Vulkan.

  • Brave Leo now uses Mixtral 8x7B as default
    7 projects | news.ycombinator.com | 27 Jan 2024
    Here’s an example of a custom 4 bits/weight codec for ML weights:

    https://github.com/Const-me/Cgml/blob/master/Readme.md#bcml1...

    llama.cpp does it slightly differently but still, AFAIK their quantized data formats are conceptually similar to my codec.

  • Efficient LLM inference solution on Intel GPU
    3 projects | news.ycombinator.com | 20 Jan 2024
  • Vcc – The Vulkan Clang Compiler
    9 projects | news.ycombinator.com | 9 Jan 2024
    > the API was high-friction due to the shader language, and the glue between shader and CPU

    Direct3D 11 compute shaders share these things with Vulkan, yet D3D11 is relatively easy to use. For example, see that library which implements ML-targeted compute shaders for C# with minimal friction: https://github.com/Const-me/Cgml The backend implemented in C++ is rather simple, just binds resources and dispatches these shaders.

    I think the main usability issue with Vulkan is API design. Vulkan was only designed with AAA game engines in mind. The developers of these game engines have borderline unlimited budgets, and their requirements are very different from ordinary folks who want to leverage GPU hardware.

  • I made an app that runs Mistral 7B 0.2 LLM locally on iPhone Pros
    12 projects | news.ycombinator.com | 7 Jan 2024
    Minor update https://github.com/Const-me/Cgml/releases/tag/1.1a Can’t edit that comment anymore, too late.

mlx

Posts with mentions or reviews of mlx. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-28.
  • Ollama v0.1.33 with Llama 3, Phi 3, and Qwen 110B
    11 projects | news.ycombinator.com | 28 Apr 2024
    Yes, we are also looking at integrating MLX [1] which is optimized for Apple Silicon and built by an incredible team of individuals, a few of which were behind the original Torch [2] project. There's also TensorRT-LLM [3] by Nvidia optimized for their recent hardware.

    All of this of course acknowledging that llama.cpp is an incredible project with competitive performance and support for almost any platform.

    [1] https://github.com/ml-explore/mlx

    [2] https://en.wikipedia.org/wiki/Torch_(machine_learning)

    [3] https://github.com/NVIDIA/TensorRT-LLM

  • Ask HN: What is the current (Apr. 2024) gold standard of running an LLM locally?
    11 projects | news.ycombinator.com | 1 Apr 2024
    If you're able to purchase a separate GPU, the most popular option is to get an NVIDIA RTX3090 or RTX4090.

    Apple Mac M2 or M3's are becoming a viable option because of MLX https://github.com/ml-explore/mlx . If you are getting an M series Mac for LLMs, I'd recommend getting something with 24GB or more of RAM.

  • MLX Community Projects
    1 project | news.ycombinator.com | 8 Feb 2024
  • FLaNK 15 Jan 2024
    21 projects | dev.to | 15 Jan 2024
  • Why the M2 is more advanced that it seemed
    5 projects | news.ycombinator.com | 15 Jan 2024
  • I made an app that runs Mistral 7B 0.2 LLM locally on iPhone Pros
    12 projects | news.ycombinator.com | 7 Jan 2024
    3) Not Enough Benefit (For the Cost... Yet!)

    This is my best understanding based on my own work and research for a local LLM iOS app. Read on for more in-depth justifications of each point!

    -—-

    1) No Neural Engine API

    - There is no developer API to use the Neural Engine programmatically, so CoreML is the only way to be able to use it.

    2) CoreML has challenges modeling LLMs efficiently right now.

    - Its most-optimized use cases seem tailored for image models, as it works best with fixed input lengths[1][2], which are fairly limiting for general language modeling (are all prompts, sentences and paragraphs, the same number of tokens? do you want to pad all your inputs?).

    - CoreML features limited support for the leading approaches for compressing LLMs (quantization, whether weights-only or activation-aware). Falcon-7b-instruct (fp32) in CoreML is 27.7GB [3], Llama-2-chat (fp16) is 13.5GB [4] — neither will fit in memory on any currently shipping iPhone. They'd only barely fit on the newest, highest-end iPad Pros.

    - HuggingFace‘s swift-transformers[5] is a CoreML-focused library under active development to eventually help developers with many of these problems, in addition to an `exporters` cli tool[6] that wraps Apple's `coremltools` for converting PyTorch or other models to CoreML.

    3) Not Enough Benefit (For the Cost... Yet!)

    - ANE & GPU (Metal) have access to the same unified memory. They are both subject to the same restrictions on background execution (you simply can't use them in the background, or your app is killed[7]).

    - So the main benefit from unlocking the ANE would be multitasking: running an ML task in parallel with non-ML tasks that might also require the GPU: e.g. SwiftUI Metal Shaders, background audio processing (shoutout Overcast!), screen recording/sharing, etc. Absolutely worthwhile to achieve, but for the significant work required and the lack of ecosystem currently around CoreML for LLMs specifically, the benefits become less clear.

    - Apple's hot new ML library, MLX, only uses Metal for GPU[8], just like Llama.cpp. More nuanced differences arise on closer inspection related to MLX's focus on unified memory optimizations. So perhaps we can squeeze out some performance from unified memory in Llama.cpp, but CoreML will be the only way to unlock ANE, which is lower priority according to lead maintainer Georgi Gerganov as of late this past summer[9], likely for many of the reasons enumerated above.

    I've learned most of this while working on my own private LLM inference app, cnvrs[10] — would love to hear your feedback or thoughts!

    Britt

    ---

    [1] https://github.com/huggingface/exporters/pull/37

    [2] https://apple.github.io/coremltools/docs-guides/source/flexi...

    [3] https://huggingface.co/tiiuae/falcon-7b-instruct/tree/main/c...

    [4] https://huggingface.co/coreml-projects/Llama-2-7b-chat-corem...

    [5] https://github.com/huggingface/swift-transformers

    [6] https://github.com/huggingface/exporters

    [7] https://developer.apple.com/documentation/metal/gpu_devices_...

    [8] https://github.com/ml-explore/mlx/issues/18

    [9] https://github.com/ggerganov/llama.cpp/issues/1714#issuecomm...

    [10] https://testflight.apple.com/join/ERFxInZg

  • Ferret: An End-to-End MLLM by Apple
    5 projects | news.ycombinator.com | 23 Dec 2023
    Maybe MLX is meant to fill this gap?

    https://github.com/ml-explore/mlx

  • PowerInfer: Fast Large Language Model Serving with a Consumer-Grade GPU [pdf]
    3 projects | news.ycombinator.com | 19 Dec 2023
    This is basically fork of llama.cpp. I created a PR to see the diff and added my comments on it: https://github.com/ggerganov/llama.cpp/pull/4543

    One thing that caught my interest is this line from their readme:

    > PowerInfer exploits such an insight to design a GPU-CPU hybrid inference engine: hot-activated neurons are preloaded onto the GPU for fast access, while cold-activated neurons are computed on the CPU, thus significantly reducing GPU memory demands and CPU-GPU data transfers.

    Apple's Metal/M3 is perfect for this because CPU and GPU share memory. No need to do any data transfers. Checkout mlx from apple: https://github.com/ml-explore/mlx

  • Whisper: Nvidia RTX 4090 vs. M1 Pro with MLX
    10 projects | news.ycombinator.com | 13 Dec 2023
    How does this compare to insanely-fast-whisper though? https://github.com/Vaibhavs10/insanely-fast-whisper

    I think that not using optimizations allows this to be a 1:1 comparison, but if the optimizations are not ported to MLX, then it would still be better to use a 4090.

    Having looked at MLX recently, I think it's definitely going to get traction on Macs - and iOS when Swift bindings are released https://github.com/ml-explore/mlx/issues/15 (although there might be some C++20 compilation issue blocking right now).

  • [D] M3 MAX 64GB VS RTX 3080
    1 project | /r/MachineLearning | 8 Dec 2023
    software is already there, check the new ml framework from Apple https://github.com/ml-explore/mlx

What are some alternatives?

When comparing Cgml and mlx you can also consider the following projects:

PowerInfer - High-speed Large Language Model Serving on PCs with Consumer-grade GPUs

cog-whisper-diarization - Cog implementation of transcribing + diarization pipeline with Whisper & Pyannote

ollama - Get up and running with Llama 3, Mistral, Gemma, and other large language models.

llama.cpp - LLM inference in C/C++

EmotiVoice - EmotiVoice 😊: a Multi-Voice and Prompt-Controlled TTS Engine

enchanted - Enchanted is iOS and macOS app for chatting with private self hosted language models such as Llama2, Mistral or Vicuna using Ollama.

llamafile - Distribute and run LLMs with a single file.

swift-transformers - Swift Package to implement a transformers-like API in Swift

clspv - Clspv is a compiler for OpenCL C to Vulkan compute shaders

mlx-examples - Examples in the MLX framework

HIP - HIP: C++ Heterogeneous-Compute Interface for Portability

mlx-playground - mlx implementations of various transformers, speedups, training