# \#reactant

**URL:** https://discourse.julialang.org/tag/reactant/1709.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [\[ANN\] ReactantNitro.jl: Reactant-first training framework](https://discourse.julialang.org/t/ann-reactantnitro-jl-reactant-first-training-framework/139500)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 4\
**Last updated:** [September 22, 2026, 7:47am UTC](https://discourse.julialang.org/t/ann-reactantnitro-jl-reactant-first-training-framework/139500 "2026-09-22T07:47:15Z")

</div>

I’m excited to finally release ReactantNitro.jl; a Reactant-first training framework inspired by PyTorch Lightning, but specifically designed around making working with Reactant.jl easy while still allowing for a large a…

---

## [ReactantServer.jl: serve more models per GPU with Reactant.jl and XLA (gauging interest)](https://discourse.julialang.org/t/reactantserver-jl-serve-more-models-per-gpu-with-reactant-jl-and-xla-gauging-interest/137358)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 17\
**Last updated:** [September 13, 2026, 8:27pm UTC](https://discourse.julialang.org/t/reactantserver-jl-serve-more-models-per-gpu-with-reactant-jl-and-xla-gauging-interest/137358 "2026-09-13T20:27:02Z")

</div>

I have been building a Julia inference server and want to find out whether others would find it useful before investing more in polishing it for general use. Feedback, criticism, and “we already have this, it is called X…

---

## [EnzymeCon3 Planning Survey](https://discourse.julialang.org/t/enzymecon3-planning-survey/139173)

<div class="topic-metadata">

**Author:** [@wsmoses](https://discourse.julialang.org/u/wsmoses)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 8:00pm UTC](https://discourse.julialang.org/t/enzymecon3-planning-survey/139173 "2026-09-02T20:00:21Z")

</div>

Hey folks, we’re in the process of planning EnzymeCon3. If you’re potentially interested in the event (or have ideas/feedback you’d like to share), please fill out this survey. All work related to the greater Enzyme c…

---

## [Where do these NaNs in my KernelAbstraction derivative come from?](https://discourse.julialang.org/t/where-do-these-nans-in-my-kernelabstraction-derivative-come-from/139105)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 0\
**Last updated:** [August 30, 2026, 5:35pm UTC](https://discourse.julialang.org/t/where-do-these-nans-in-my-kernelabstraction-derivative-come-from/139105 "2026-08-30T17:35:37Z")

</div>

Hi, I (mostly chatgpt though) am working on an MHD code using KernelAbstractions.jl, Reactant.jl and Enzyme.jl. In one step, a kernel derivative produces NaNs whereas the reactant gradient using plain arrays gives corre…

---

## [\[WIP\] ONNXExport.jl - Export Julia functions to ONNX](https://discourse.julialang.org/t/wip-onnxexport-jl-export-julia-functions-to-onnx/138588)

<div class="topic-metadata">

**Author:** [@martinkjlarsson](https://discourse.julialang.org/u/martinkjlarsson)\
**Replies:** 0\
**Last updated:** [August 4, 2026, 7:14am UTC](https://discourse.julialang.org/t/wip-onnxexport-jl-export-julia-functions-to-onnx/138588 "2026-08-04T07:14:27Z")

</div>

Hello, What ONNXExport.jl is a package for exporting Julia functions as ONNX models. It is still an unregistered WIP but has a decent coverage of Julia, NNlib, MLUtils, and Lux functions. See the README for detailed cov…

---

## [Reactant.jl recompiles function each time it is called](https://discourse.julialang.org/t/reactant-jl-recompiles-function-each-time-it-is-called/137429)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 7\
**Last updated:** [June 3, 2026, 5:10pm UTC](https://discourse.julialang.org/t/reactant-jl-recompiles-function-each-time-it-is-called/137429 "2026-06-03T17:10:36Z")

</div>

I am trying to use an optimiser from Manopt.jl to train a Lux.jl neural network using Reactant.jl. It is orders of magnitude slower than without Reactant.jl. Does anyone know how to fix it? The compiled functions, when …

---

## [Lux & Reactant on Colab TPUs](https://discourse.julialang.org/t/lux-reactant-on-colab-tpus/126926)

<div class="topic-metadata">

**Author:** [@avikpal](https://discourse.julialang.org/u/avikpal)\
**Replies:** 5\
**Last updated:** [May 21, 2026, 5:30pm UTC](https://discourse.julialang.org/t/lux-reactant-on-colab-tpus/126926 "2026-05-21T17:30:22Z")

</div>

Colab now has Lux and Reactant pre-installed. Here’s a starter script for TPUs (change the runtime, and it will automatically work on CPU or GPU)

---

## [Issues with Reactant unable to find GPU on Colab, but CUDA.jl can](https://discourse.julialang.org/t/issues-with-reactant-unable-to-find-gpu-on-colab-but-cuda-jl-can/129360)

<div class="topic-metadata">

**Author:** [@arrowmancer](https://discourse.julialang.org/u/arrowmancer)\
**Replies:** 7\
**Last updated:** [May 21, 2026, 5:30pm UTC](https://discourse.julialang.org/t/issues-with-reactant-unable-to-find-gpu-on-colab-but-cuda-jl-can/129360 "2026-05-21T17:30:09Z")

</div>

Hi guys, currently when using the Julia backend on Google Colab, I haven’t been able to get Reactant to find any Nvidia GPUs when I select a GPU runtime on Colab. E.g. when I select A100 or the L4 GPU, and then try to r…

---

## [Reactant.jl CUDA Version](https://discourse.julialang.org/t/reactant-jl-cuda-version/137211)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 0\
**Last updated:** [May 20, 2026, 11:45am UTC](https://discourse.julialang.org/t/reactant-jl-cuda-version/137211 "2026-05-20T11:45:16Z")

</div>

Is there a recommended CUDA driver version + version of CUDA.jl I should be using with Reactant.jl? It looks like there are conflicting versions of CUDA somewhere. I0000 00:00:1779236186.222218 3515013 service.cc:178\] X…

---

## [Error and Segfault with DeviceIterator for parallel DataLoader on sharded ReactantDevice](https://discourse.julialang.org/t/error-and-segfault-with-deviceiterator-for-parallel-dataloader-on-sharded-reactantdevice/137074)

<div class="topic-metadata">

**Author:** [@benjwweber](https://discourse.julialang.org/u/benjwweber)\
**Replies:** 1\
**Last updated:** [May 14, 2026, 10:28pm UTC](https://discourse.julialang.org/t/error-and-segfault-with-deviceiterator-for-parallel-dataloader-on-sharded-reactantdevice/137074 "2026-05-14T22:28:16Z")

</div>

I am trying to load a data set via a DataLoader/DeviceIterator to a sharded ReactantDevice. I have replicated it here with a mock data set. However I run into a variety of errors or segfaults if I do this. Is there anyth…

---

## [Pathological compile times training a Lux+CUDA descriptor CNN with a similarity-matrix (SupCon) loss — Reactant, Zygote, and manual loops all hang on first step](https://discourse.julialang.org/t/pathological-compile-times-training-a-lux-cuda-descriptor-cnn-with-a-similarity-matrix-supcon-loss-reactant-zygote-and-manual-loops-all-hang-on-first-step/136884)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 2\
**Last updated:** [April 26, 2026, 11:49am UTC](https://discourse.julialang.org/t/pathological-compile-times-training-a-lux-cuda-descriptor-cnn-with-a-similarity-matrix-supcon-loss-reactant-zygote-and-manual-loops-all-hang-on-first-step/136884 "2026-04-26T11:49:43Z")

</div>

\--- Body: I’ve been trying to train a small descriptor CNN (~1M params, 64×64 grayscale patch input → 128-dim L2-normalized embedding) with a Supervised Contrastive (SupCon) loss in pure Julia / Lux on a single B200…

---

## [Enzyme/Reactant: second-order AD (Laplacian) not working with Lux on GPU](https://discourse.julialang.org/t/enzyme-reactant-second-order-ad-laplacian-not-working-with-lux-on-gpu/136444)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 5\
**Last updated:** [April 1, 2026, 6:39am UTC](https://discourse.julialang.org/t/enzyme-reactant-second-order-ad-laplacian-not-working-with-lux-on-gpu/136444 "2026-04-01T06:39:23Z")

</div>

Hi all, I’m implementing VMC (Variational Monte Carlo) for quantum many-body systems in the continuum, where I need to compute the Laplacian ∇²logψ/ψ of a neural network wavefunction. I’m trying to use Lux + Reactant +…

---

## [Reactant.jl + Enzyme: ~10 min compilation overhead triggered by hidden-to-hidden Dense layers](https://discourse.julialang.org/t/reactant-jl-enzyme-10-min-compilation-overhead-triggered-by-hidden-to-hidden-dense-layers/136374)

<div class="topic-metadata">

**Author:** [@Yuan-Ru-Lin](https://discourse.julialang.org/u/Yuan-Ru-Lin)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 11:22am UTC](https://discourse.julialang.org/t/reactant-jl-enzyme-10-min-compilation-overhead-triggered-by-hidden-to-hidden-dense-layers/136374 "2026-03-27T11:22:11Z")

</div>

I’ve been investigating compilation times with Reactant.jl + Lux + AutoEnzyme() on an NVIDIA GPU and found a reproducible jump in TTFT (Time-To-First-Training) when a model includes hidden-to-hidden Dense layers. Minima…

---

## [Optimizing Lux.jl and Reactant.jl performance](https://discourse.julialang.org/t/optimizing-lux-jl-and-reactant-jl-performance/135942)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 3\
**Last updated:** [March 6, 2026, 8:58pm UTC](https://discourse.julialang.org/t/optimizing-lux-jl-and-reactant-jl-performance/135942 "2026-03-06T20:58:07Z")

</div>

I am facing two separate issues. One is related to setting Reactant initialization options to improve performance and the other is about avoiding unnecessary latencies in neural network training loop via compilation. No…

---

## [Reactant: how to use it, limititations and opportunities?](https://discourse.julialang.org/t/reactant-how-to-use-it-limititations-and-opportunities/135559)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 1\
**Last updated:** [February 11, 2026, 12:49am UTC](https://discourse.julialang.org/t/reactant-how-to-use-it-limititations-and-opportunities/135559 "2026-02-11T00:49:04Z")

</div>

After reading a few posts (and some suggestion from @wmshen0323 to try Enzyme), Reactant got my attention. My understanding is that, if I manage to compile my code with Reactant, I get for free to run my code on GPUs and…

---

## [Use of Reactant.jl on existing framework](https://discourse.julialang.org/t/use-of-reactant-jl-on-existing-framework/135261)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 9\
**Last updated:** [January 26, 2026, 4:09pm UTC](https://discourse.julialang.org/t/use-of-reactant-jl-on-existing-framework/135261 "2026-01-26T16:09:17Z")

</div>

Hello, I have some generic function that tests some functionalities of a package. The function does something like this function shared\_function(T, array\_type) x = rand(T, 10, 10) dx = array\_type(x) @test s…

---

## [Are there alternatives to Diagonal and eigvals compatible with Reactant?](https://discourse.julialang.org/t/are-there-alternatives-to-diagonal-and-eigvals-compatible-with-reactant/135081)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 13\
**Last updated:** [January 26, 2026, 3:22am UTC](https://discourse.julialang.org/t/are-there-alternatives-to-diagonal-and-eigvals-compatible-with-reactant/135081 "2026-01-26T03:22:02Z")

</div>

Hello! I’m in the process of refactoring a complicated function so that it can be compiled by Reactant. It has not been very straightforward, but the speedup I’ve seen so far certainly justifies the effort. Nonetheless…

---

## [Best Practices for Mutation with Reactant.jl](https://discourse.julialang.org/t/best-practices-for-mutation-with-reactant-jl/135256)

<div class="topic-metadata">

**Author:** [@lance\_xwq](https://discourse.julialang.org/u/lance_xwq)\
**Replies:** 1\
**Last updated:** [January 25, 2026, 4:23pm UTC](https://discourse.julialang.org/t/best-practices-for-mutation-with-reactant-jl/135256 "2026-01-25T16:23:01Z")

</div>

Hello, I have been exploring Reactant.jl and JAX to develop a package for my research project. One thing I noticed about JAX is that it does not really allow in-place mutation of variables. I’ve seen several explanation…

---

## [Slow Reactant compilation for modified DeepONet](https://discourse.julialang.org/t/slow-reactant-compilation-for-modified-deeponet/135133)

<div class="topic-metadata">

**Author:** [@Jan\_Strube](https://discourse.julialang.org/u/Jan_Strube)\
**Replies:** 9\
**Last updated:** [January 23, 2026, 8:55pm UTC](https://discourse.julialang.org/t/slow-reactant-compilation-for-modified-deeponet/135133 "2026-01-23T20:55:23Z")

</div>

I’m trying to implement the modified Deep Operator Network from this paper: Improved architectures and training algorithms for deep operator networks" (arXiv:2110.01654). The addition over the vanilla DeepONet is a set …

---

## [Matrix multiplication fails with Reactant and Lux](https://discourse.julialang.org/t/matrix-multiplication-fails-with-reactant-and-lux/134612)

<div class="topic-metadata">

**Author:** [@weltenbummler](https://discourse.julialang.org/u/weltenbummler)\
**Replies:** 2\
**Last updated:** [December 17, 2025, 4:34pm UTC](https://discourse.julialang.org/t/matrix-multiplication-fails-with-reactant-and-lux/134612 "2025-12-17T16:34:06Z")

</div>

Hello, I have this simple script: using LinearAlgebra using Reactant using Lux dev = reactant\_device() #dev = cpu\_device() A = dev(rand(Float32, 2, 2)) B = dev(rand(Float32, 2, 3)) A \* B # ERROR: conversion to point…

---

## [KernelAbstractions + CUDA + Reactant - how to get minimal working example](https://discourse.julialang.org/t/kernelabstractions-cuda-reactant-how-to-get-minimal-working-example/134164)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.julialang.org/u/Jakub_Mitura)\
**Replies:** 12\
**Last updated:** [November 30, 2025, 6:34am UTC](https://discourse.julialang.org/t/kernelabstractions-cuda-reactant-how-to-get-minimal-working-example/134164 "2025-11-30T06:34:06Z")

</div>

Hello I tried to get minimal working example for reactant powered kernel abstractions plus Enzyme like using Pkg Pkg.activate(".") using Reactant using KernelAbstractions using CUDA using Enzyme using Test # Simple squ…

---

## [Type instability in custom Lux masking layer when using Enzyme/Reactant](https://discourse.julialang.org/t/type-instability-in-custom-lux-masking-layer-when-using-enzyme-reactant/133042)

<div class="topic-metadata">

**Author:** [@pietro-butti](https://discourse.julialang.org/u/pietro-butti)\
**Replies:** 5\
**Last updated:** [October 10, 2025, 5:25pm UTC](https://discourse.julialang.org/t/type-instability-in-custom-lux-masking-layer-when-using-enzyme-reactant/133042 "2025-10-10T17:25:01Z")

</div>

I’m encountering issues when implementing a custom Lux layer that performs masking (as commonly used in RealNVPs). Example in 1D with checkerboard masking: \[x1, x2, x3, x4\] → (\[x1,0,x3,0\], \[0,x2,0,x4\]) Goal I want to …

---

## [Reactant.jl and Lux.jl don't work with Adam optimiser](https://discourse.julialang.org/t/reactant-jl-and-lux-jl-dont-work-with-adam-optimiser/132278)

<div class="topic-metadata">

**Author:** [@flick](https://discourse.julialang.org/u/flick)\
**Replies:** 9\
**Last updated:** [September 30, 2025, 10:54pm UTC](https://discourse.julialang.org/t/reactant-jl-and-lux-jl-dont-work-with-adam-optimiser/132278 "2025-09-30T22:54:14Z")

</div>

I am writing a training program for the VAEAC model, but when I use Optimisers.Adam(lr), I get an error. When I use, for example, Optimisers.Descent(lr), this problem does not occur. Error message: ERROR: MethodError: …

---

## [Reactant.jl compile times and memory usage](https://discourse.julialang.org/t/reactant-jl-compile-times-and-memory-usage/132655)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 9\
**Last updated:** [September 25, 2025, 9:39pm UTC](https://discourse.julialang.org/t/reactant-jl-compile-times-and-memory-usage/132655 "2025-09-25T21:39:41Z")

</div>

I’m trying to do some ML experiments using Lux and Reactant. Without posting all of the code, I was wondering if I’m using Reactant properly, because I’m getting compile times of around 3 minutes, and gigabytes of memory…

---

## [What is the correct way to autodiff a simple CUDA kernel using Reactant.jl and Enzyme.jl](https://discourse.julialang.org/t/what-is-the-correct-way-to-autodiff-a-simple-cuda-kernel-using-reactant-jl-and-enzyme-jl/132572)

<div class="topic-metadata">

**Author:** [@TiangeHuang-Cedric](https://discourse.julialang.org/u/TiangeHuang-Cedric)\
**Replies:** 20\
**Last updated:** [September 23, 2025, 7:58pm UTC](https://discourse.julialang.org/t/what-is-the-correct-way-to-autodiff-a-simple-cuda-kernel-using-reactant-jl-and-enzyme-jl/132572 "2025-09-23T19:58:25Z")

</div>

I’m new to Reactant.jl and Enzyme.jl, and I want to use them to calculate the grad of a CUDA kernel. Here is my script: using Random, Reactant, CUDA, Test, Enzyme const ReactantCUDAExt = Base.get\_extension(Reactant, :R…

---

## [Using SpecialFunctions spherical bessel functions with Reactant](https://discourse.julialang.org/t/using-specialfunctions-spherical-bessel-functions-with-reactant/131993)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 3\
**Last updated:** [August 31, 2025, 6:06pm UTC](https://discourse.julialang.org/t/using-specialfunctions-spherical-bessel-functions-with-reactant/131993 "2025-08-31T18:06:56Z")

</div>

I’m trying to apply Reactant to my code which uses spherical Bessel functions from the SpecialFunctions package. I’m running into this error; has anyone been able to use spherical Bessel functions with Reactant? @avikpal …

---

## [Complex number support in Reactant](https://discourse.julialang.org/t/complex-number-support-in-reactant/131948)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 1\
**Last updated:** [August 30, 2025, 2:41am UTC](https://discourse.julialang.org/t/complex-number-support-in-reactant/131948 "2025-08-30T02:41:33Z")

</div>

I am unable to find mention of complex numbers in Reactant. Does anyone know if it supports complex, or if there are common workarounds at this point? # MWE testing if Reactant supports complex numbers using Reactant f…

---

## [Using control flow in Reactant](https://discourse.julialang.org/t/using-control-flow-in-reactant/131946)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 4\
**Last updated:** [August 29, 2025, 6:20pm UTC](https://discourse.julialang.org/t/using-control-flow-in-reactant/131946 "2025-08-29T18:20:58Z")

</div>

I’ve got some expensive code I’m running that I’d like to compile with Reactant. There is some control flow that’s not playing nice with Reactant. I’ve got an MWE producing a different error than my main code, but I’m ho…

---

## [Using Reactant with Lux and Enzyme to speed up training in physics context](https://discourse.julialang.org/t/using-reactant-with-lux-and-enzyme-to-speed-up-training-in-physics-context/131898)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 16\
**Last updated:** [August 28, 2025, 8:56pm UTC](https://discourse.julialang.org/t/using-reactant-with-lux-and-enzyme-to-speed-up-training-in-physics-context/131898 "2025-08-28T20:56:28Z")

</div>

I am training a neural network in a physical context on observables; crucially, the network is producing values which are passed through some physics calculations before being compared to the training data. My code works…

---

## [I heard lux.jl is moving to reactant.jl. Where can I help?](https://discourse.julialang.org/t/i-heard-lux-jl-is-moving-to-reactant-jl-where-can-i-help/131625)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 4\
**Last updated:** [August 15, 2025, 8:43am UTC](https://discourse.julialang.org/t/i-heard-lux-jl-is-moving-to-reactant-jl-where-can-i-help/131625 "2025-08-15T08:43:05Z")

</div>

I heard lux.jl is moving to reactant.jl. Personally, that’s a really good news. Not only would it probably be something actionable for me (like implementing machine learning layers), it could also help me get closer to r…

[Next page](https://discourse.julialang.org/tag/reactant/1709.md?match_all_tags=true&page=1&tags%5B%5D=reactant)
