# Diamond,

Published articles for Diamond,.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Gemma 3 AI model in Clojure

DevFeed: [Gemma 3 AI model in Clojure](<https://devfeed.tech/articles/gemma-3-ai-model-in-clojure-20729.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/25/Gemma-3-AI-model-in-Clojure>)

Published: 2025-12-09T22:35:00Z

Content type: tutorial

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [onnx](<https://devfeed.tech/topics/onnx.md>), [gemma](<https://devfeed.tech/topics/gemma.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [ai](<https://devfeed.tech/tags/ai.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [code](<https://devfeed.tech/tags/code.md>), [deep](<https://devfeed.tech/tags/deep.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [gemma](<https://devfeed.tech/tags/gemma.md>), [inference](<https://devfeed.tech/tags/inference.md>), [llms](<https://devfeed.tech/tags/llms.md>), [onnx](<https://devfeed.tech/tags/onnx.md>)

### AI overview

This tutorial demonstrates loading and running a one-step Gemma 3 inference in Clojure through the ONNX runtime integration in Deep Diamond. It configures a smaller one-billion-parameter model, uses main-memory tensors with the oneDNN engine, and explains that the demonstrated output is a next-token tensor rather than a complete generated response.

### Source excerpt

Recently I've been working on the ONNX runtime integration into Deep Diamond, backed by the grant sponsored by the Clojurists Together Foundation. In the past few articles, we've seen how ONNX models are integrated into Deep Diamond, using only a single function onnx, with almost no need for additional configuration (which is available). I used a simple MNIST model in the demonstration. But, can we now load and run the inference on the real deal models, such as the open LLMs from the Hugging Face, for example? Let's see! The Hugging Face model card has this to say about Gemma 3: "Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models." (etc., etc.) So, it seems to be something worth trying. I'll try to be brief, and skip the unnecessary talk. Let's just show the code, which I've just lifted up and adapted from the Diamond's midje tests. What we need for this? First, decide on the backend engine; this time we'll use tensors in main memory backed up by the oneDNN engine (DNNL). (def fact (dnnl-factory)) (def neand-fact (neanderthal-factory fact)) Next, load and configure a particular flavor of Gemma 3 (a smaller one, only 1 billion parameters). The onnx function creates a generalized blueprint, which can create the actual functions when evaluated with the specific input tensors. (def onnx-bp (onnx fact "data/gemma-3-1b-it-ONNX-GQA/onnx/model.onnx" {:options (-> (options) (override-dimension! "batch_size" 1) (override-dimension! "sequence_length" 1) (override-dimension! "past_sequence_length" 1) (override-dimension! "total_sequence_length" 1))}) Gemma 3 has 63 inputs and 61 outputs. We'll need to provide these, but even here we can automate some parts with Clojure, since past-key values are pretty uniform. We only need to provide inputs, while the engine can create the outputs for us. (def src-tz (tensor fact [1 1 28 28] :float :nchw)) (def input-ids (tensor neand-fact [1

## Four ways to run ONNX models on a GPU with CUDA in Clojure

DevFeed: [Four ways to run ONNX models on a GPU with CUDA in Clojure](<https://devfeed.tech/articles/not-one-not-two-not-even-three-but-four-ways-to-run-an-onnx-ai-model-on-gpu-with-cuda-20728.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/25/Four-Ways-to-ONNX-on-GPU-in-Clojure-and-CUDA>)

Published: 2025-11-09T17:49:00Z

Content type: tutorial

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [CUDA](<https://devfeed.tech/topics/cuda.md>), [GPU](<https://devfeed.tech/topics/gpu.md>), [onnx](<https://devfeed.tech/topics/onnx.md>), [Clojure](<https://devfeed.tech/topics/clojure.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Deep neural networks](<https://devfeed.tech/topics/deep-neural-networks.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [code](<https://devfeed.tech/tags/code.md>), [cuda](<https://devfeed.tech/tags/cuda.md>), [deep](<https://devfeed.tech/tags/deep.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [examples](<https://devfeed.tech/tags/examples.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [image-recognition](<https://devfeed.tech/tags/image-recognition.md>), [model](<https://devfeed.tech/tags/model.md>), [neural-networks](<https://devfeed.tech/tags/neural-networks.md>), [onnx](<https://devfeed.tech/tags/onnx.md>), [tensors](<https://devfeed.tech/tags/tensors.md>)

### AI overview

A tutorial presents four ways to run ONNX models on a GPU with CUDA using Clojure libraries including Diamond ONNX RT, Deep Diamond, and ClojureCUDA. It covers GPU tensor backends and a configuration that keeps input and output tensors in main memory while executing the model on the GPU.

### Source excerpt

Two weeks ago, I announced a new Clojure ML library, Diamond ONNX RT, which integrates ONNX Runtime into Deep Diamond. In that post, we explored the classic Hello World example of Neural Networks, MNIST handwritten image recognition, step-by-step. We run that example on the CPU, from main memory. The next logical step is to execute this stuff on the GPU. You'll see that with a little help of ClojureCUDA and Deep Diamond built-in CUDA machinery, this is both easy and simple, requiring almost no effort from a curious Clojure programmer. But don't just trust me; let's fire up your REPL, and we can continue together. Here's how you can evaluate this directly in your REPL (you can use the Hello World that is provided in the ./examples sub-folder of Diamond ONNX RT as a springboard). Require Diamond's namespaces First things first, we refer functions that we're going to use. (require '[uncomplicate.commons.core :refer [with-release]] '[uncomplicate.neanderthal.core :refer [transfer! iamax native]] '[uncomplicate.diamond [tensor :refer [tensor with-diamond]] [dnn :refer [network]] [onnxrt :refer [onnx]]] '[uncomplicate.diamond.internal.dnnl.factory :refer [dnnl-factory]] '[uncomplicate.diamond.internal.cudnn.factory :refer [cudnn-factory]] '[hello-world.native :refer [input-desc input-tz mnist-onnx]]) None of the following ways to run CUDA models has preference, you use the one that best suits your needs. Way one One of the ways to run ONNX models on your GPU is to simply use Deep Diamond's cuDNN factory as the backend for your tensors. Then, the machinery recognizes what you need and proceeds doing everything on the GPU, using the right stream for tensors, Deep Diamond operations, and ONNX Runtime operations. This looks exactly the same as any other Deep Diamond example from this blog or the DLFP book. (with-diamond cudnn-factory [] (with-release [cuda-input-tz (tensor input-desc) mnist (network cuda-input-tz [mnist-onnx]) classify! (mnist cuda-input-tz)] (transfer! input

## Get Ready for Clojure, GPU, and AI in 2026 with CUDA 13.0

DevFeed: [Get Ready for Clojure, GPU, and AI in 2026 with CUDA 13.0](<https://devfeed.tech/articles/get-ready-for-clojure-gpu-and-ai-in-2026-with-cuda-13-0-20730.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/25/Get-Ready-Clojure-GPU-AI-2026-CUDA-13>)

Published: 2025-10-30T16:37:00Z

Content type: tutorial

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [CUDA](<https://devfeed.tech/topics/cuda.md>), [GPU](<https://devfeed.tech/topics/gpu.md>), [OpenCL](<https://devfeed.tech/topics/opencl.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [coding](<https://devfeed.tech/tags/coding.md>), [cuda](<https://devfeed.tech/tags/cuda.md>), [deep](<https://devfeed.tech/tags/deep.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [opencl](<https://devfeed.tech/tags/opencl.md>), [tensors](<https://devfeed.tech/tags/tensors.md>)

### AI overview

The article introduces ClojureCUDA 0.25.0, which supports CUDA 13.0.2, and encourages Clojure developers to try GPU programming interactively through the Clojure REPL. It explains that GPU acceleration is most useful for large vectors and sufficiently complex workloads because data transfer costs can outweigh computation gains.

### Source excerpt

A little anniversary Did you know that CUDA has been available in Clojure for the last 9 years through ClojureCUDA, and GPU programming through OpenCL for more than 10? I almost forgot about these anniversaries. Ten years ago most people liked it a lot, starred it on Github, patted me on the back, but then concluded that they don't have an Nvidia card available on their laptops, or, if they had GPUs, that they won't have time to learn to think in massive parallel algorithms, or if they have time and will, that there are no GPUs in the servers, so what would they do with their applications, even if they created them in Clojure, and so on, and so off :) But, ClojureCUDA and ClojureCL continued living on for these 10 years, I used them in creating Neanderthal, Deep Diamond, and Diamond ML, and they proved themselves as simple and reliable tools. I still had trouble convincing Clojure programmers that they can write GPU programs that run as fast as they'd wrote them in C++, but interactively in the Cloujre REPL, without C++ hell. But I'm not easy to shake off! If it's necessary, I'll continue for 10 more years, for I'm convinced there'd be a moment when Clojure programmers are going to say "hmmm, this is something that we can use and be good at!". CUDA 13 is here! I've recently released ClojureCUDA 0.25.0, with support for the latest CUDA 13.0.2! Why not celebrate that by opening the REPL, and coding your first Hello World application on the GPU? I promise, it won't be a usual GPU carpet of text; this is ClojureCUDA, it follows the Clojure philosophy by being simple and interactive! There's not much sense in wielding a GPU to print out "Hello World". Note that it is also not very useful to work with scalar numbers and call a GPU function to add or multiply two numbers. No. Unless you have many, many, numbers to crunch, stay by your trusty CPU. For our purposes, many, many, numbers would be two vectors of dimension 3 (hey, it's hello world; imagine it's 3 billion). Also,

## Clojure API for Running ONNX Models with ONNX Runtime

DevFeed: [Clojure API for Running ONNX Models with ONNX Runtime](<https://devfeed.tech/articles/clojure-runs-onnx-ai-models-now-join-the-ai-fun-20727.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/25/Clojure-Runs-ONNX-AI-Models-Now>)

Published: 2025-10-26T15:56:00Z

Content type: tutorial

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [onnx](<https://devfeed.tech/topics/onnx.md>), [AI Models](<https://devfeed.tech/topics/ai-models.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [deep](<https://devfeed.tech/tags/deep.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [onnx](<https://devfeed.tech/tags/onnx.md>), [tensors](<https://devfeed.tech/tags/tensors.md>)

### AI overview

The author describes work on a Clojure API for using pre-trained models exported in ONNX format through ONNX Runtime. The approach uses ONNX Runtime's underlying C library rather than Python interoperability.

### Source excerpt

Hello, Clojurians! I haven't written here in a long time. Was I tired? Is anybody reading blogs anymore? Who knows. But that was not the main reason. I've been working on several Clojure projects sponsored by the Clojurists Together Foundation. I did a ton of things, but after all this programming, I was kinda tired, and kept slugging when it comes to telling people about the work done! That's not very smart, but you know how it goes... :) But, then, if we don't tell people about awesome software that we have, nobody is going to use it, so finally I had to stop kicking this down the road, sit, and write the first post. It's been long overdue, so expect more posts soon! ONNX Runtime in one line of Clojure The most recent thing I'm currently working on started its life as Clojure ML (again, superthanks to Clojurists Together for sponsoring this). I proposed to create a human-friendly Clojure API for AI/DL/ML models, and back it by the first implementation, in this case based on ONNX Runtime. Of course, it should all be integrated into existing Clojure libraries, and follow the Clojure way of doing stuff as much as possible! The idea is to get an existing, pre-trained ML model previously exported to the ONNX format from whatever technology the authors chose (which in today's world is typically Python and PyTorch), and put it into production in Clojure and JVM. It should be seamless and in-process, without any clunky interoperability, copy, translation, etc. Of course, our Clojure numerical libraries fully support GPU computing, so it goes without saying that we want that, too! Just to be clear, we do not use nor need any Python or Python interop for this, we use the ONNX Runtime's underlying C library. Nice idea, but what parts of this well intended story can we evaluate in our REPLs right now? At least some promising demo? Are we on the trail? To access that AI goodness, we surely have to do a sophisticated dance? Are the steps hard to learn? Do we need to watch careful

## New Socket Shapes

DevFeed: [New Socket Shapes](<https://devfeed.tech/articles/new-socket-shapes-19179.md>)

Original publisher: [Read original article](<https://code.blender.org/2025/08/new-socket-shapes/>)

Author: Jacques Lucke

Published: 2025-08-08T07:41:15Z

Content type: article

Language: en

Sources: [Blender](<https://devfeed.tech/sources/blender.md>)

Topics: [Development](<https://devfeed.tech/topics/development.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [blender](<https://devfeed.tech/tags/blender.md>), [design](<https://devfeed.tech/tags/design.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [general-development](<https://devfeed.tech/tags/general-development.md>), [geometry-nodes](<https://devfeed.tech/tags/geometry-nodes.md>), [node](<https://devfeed.tech/tags/node.md>), [structure](<https://devfeed.tech/tags/structure.md>), [types](<https://devfeed.tech/tags/types.md>), [volume](<https://devfeed.tech/tags/volume.md>)

### AI overview

The article explains Blender 5.0's redesign of Geometry Nodes socket shapes. It describes the limitations of the previous shapes, the need to support newer socket types such as lists and volume grids, and how socket shape, color, and tooltips communicate data structure and analysis information.

### Source excerpt

Changing the meaning of socket shapes for Blender 5.0.

## Recurrent Networks Hello World in Clojure with new Deep Diamond RNN support on CPU and GPU

DevFeed: [Recurrent Networks Hello World in Clojure with new Deep Diamond RNN support on CPU and GPU](<https://devfeed.tech/articles/recurrent-networks-hello-world-in-clojure-with-new-deep-diamond-rnn-support-on-cpu-and-gpu-20724.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/22/Recurrent-networks-hello-world-sequence-prediction-in-Clojure-with-new-Deep-Diamond>)

Published: 2022-08-26T14:25:00Z

Content type: tutorial

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [Deep learning](<https://devfeed.tech/topics/deep-learning.md>), [Time Series](<https://devfeed.tech/topics/time-series.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [clojure](<https://devfeed.tech/tags/clojure.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [deep](<https://devfeed.tech/tags/deep.md>), [deep-learning](<https://devfeed.tech/tags/deep-learning.md>), [diamond](<https://devfeed.tech/tags/diamond.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [learning](<https://devfeed.tech/tags/learning.md>), [networks](<https://devfeed.tech/tags/networks.md>), [neural](<https://devfeed.tech/tags/neural.md>), [programming](<https://devfeed.tech/tags/programming.md>), [recurrent](<https://devfeed.tech/tags/recurrent.md>), [rnn](<https://devfeed.tech/tags/rnn.md>), [time-series](<https://devfeed.tech/tags/time-series.md>)

### AI overview

A beginner-friendly Clojure tutorial demonstrates recurrent neural networks in Deep Diamond by training a model to predict the next value in a simple numerical sequence. It introduces time-series prediction and notes that the example can run on CPU and GPU.

### Source excerpt

I've been busy in the last period working on new major features in Deep Diamond, one of which is the support for Recurrent Neural Networks (RNN). It's not been an easy ride, but I can finally show you some results! Big thanks for everyone that's helping me with this by buying my books (or subscribing to the upcoming editions), and Clojurists Together, who generously funded me in the past year to work on this. I know that most of you probably don't have much more than passing familiarity with deep learning, let alone recurrent neural networks, and that's why I'll try to show a very simple example on the level of Hello World that anyone interested in machine learning and programming can understand and try. So, enough talk, let's get down to business. What are we doing We are demonstrating a hammer: recurrent neural networks. Just kidding; we would like to create a (software) device that can learn to predict the next data point in a series. Depending on the data, this can be done in a number of ways (even by convolutional neural networks (CNN) that Deep Diamond already supported), one of which is RNN. So, we are creating a recurrent network, and training it with a set of data for this task. An example of data that fits this task would be temperature at some place, stock prices, and any other (possibly infinite) sequence of numbers in one of more dimensions that have an ordinal relation, that is, has an abstract notion of time attached to it. Then, we are trying to forecast one or more values that are happening in the future (temperature the next day, or the closing price of a stock, etc.). Since Hello World has to be dead simple, a real example would have too many opaque numbers, so we'll solve an artificially trivial task of teaching our network to predict the next number in the series for obvious series such as 1, 2, 3, 4, 5. Of course, in real life we rarely need to solve that exact task with such a bazooka as RNN, but if this is your first contact with time series