r/Julia • • 1d ago

Running Julia apps on Brewlet.sh (Kubernetes)

Thumbnail github.com
4 Upvotes

r/Julia • • 1d ago

Primal is now faster and faster

Post image
11 Upvotes

PrimalSolver aims to be an open-source alternative to MOSEK for convex and mixed-integer optimization. Its portable C99 core uses only libc and libm and is available through a C API, Python, Julia, and a command-line interface.

One solver covers LP, convex QP and QCQP, SOCP, SDP, exponential and power cones, MILP, MIQP, and mixed-integer conic problems, including models with both integer variables and positive-semidefinite constraints. It combines continuous conic optimization with simplex and integer search. Continuous solutions expose primal and dual quantities for checking accuracy. Integer solves report feasible incumbents and optimality status.

What it solves

  • LP, QP — presolve, then simplex for LP or a Mehrotra interior point for LP and convex QP. Sparse QPs can reuse an augmented KKT factorization for the predictor and corrector. A working-set method handles QPs on a simplex and small diagonal QPs with bounds and inequalities. Sparse KKT · Simplex QPs
  • MILP, MIQP — branch & bound with cutting planes, strong branching, probing and primal heuristics. For some integer covers with shared capacity, Primal can certify the exact optimum using a cost cutoff and an aggregate bound on free stock. In binary minimax models with paired error slacks, a search over binary assignments supplies an incumbent. Integer covers · Binary minimax
  • SOCP — primal-dual conic interior point with Nesterov–Todd scaling. Primal can eliminate rotated epigraphs with one fixed positive member per block, including cases with up to four equalities on the tails.
  • SDP — Nesterov–Todd interior point on PSD blocks. For a single block with fixed diagonal and compatible objective signs, Primal constructs the primal and dual solution directly. It can also dualize an affine matrix inequality to remove entrywise linking rows. For two small, imbalanced PSD blocks, it equilibrates the blocks before dualizing. Presolve can detect infeasibility from exact zero diagonal constraints. Specialized log-det barriers solve free-diagonal and small affine SDPs in the original scalar coordinates. For some graph theta problems, an independent set and a clique partition certify the optimum directly. Some binary moment formulations also admit a rank-one dual certificate. Certain 2×2 PSD blocks with shared diagonals reduce to a small LP. Graph theta · Binary moments
  • Exponential and power cones — native interior point with closed-form barriers. Mixed SOC and primal exponential models, and larger models with only primal exponential cones, can use a higher-order corrector and a sparse KKT solve. For exponential epigraphs with fixed positive scales and affine arguments in up to 64 free variables, Primal can use Newton's method on the reduced problem, including a single rotated quadratic penalty. Positive weighted sums of fixed-scale epigraphs can also be reduced to log-sum-exp constraints, with affine upper inequalities kept in the reduced Newton system. For a weighted exponential sum of private hinge losses, Primal eliminates the losses from the Newton system and verifies the reconstructed conic solution. For certain weighted power-cone loss models, a penalty bound permits a reduction to LP.
  • Mixed-integer conic — branch and bound with conic relaxations. For cardinality-constrained portfolios with separate SOC, EXP and PSD risk blocks, Primal can certify a global bound from the individual blocks. The solver also certifies small binary selection problems with affine PSD constraints. Portfolio algorithm · Binary PSD selection.
  • QCQP — quadratic constraints encoded exactly as rotated quadratic cones.
  • Modeling — affine conic constraints (ACC), disjunctive constraints (DJC), SOS1/SOS2, semi-continuous and semi-integer variables.

The package PrimalSolver lives in julia/ and is also a JuMP solver. Install it next to JuMP with Julia 1.10 or later — no C compiler and no checkout, the prebuilt library comes from PrimalSolver_jll:

using Pkg
Pkg.add(["JuMP", "PrimalSolver"])

using JuMP, PrimalSolver

model = Model(PrimalSolver.Optimizer)
(model, 0 <= x <= 3.5)
(model, y >= 0)
(model, c, x + y <= 4)
u/objective(model, Max, 3x + 2y)
optimize!(model)
value(x), value(y), objective_value(model), shadow_price(c)   # (3.5, 0.5, 11.5, 2.0)

It accepts linear and convex quadratic objectives, linear constraints, binary and integer variables, and the second-order, rotated second-order, exponential and power cones; JuMP's bridges reformulate the rest. Solver parameters are set with set_attribute(model, "PRIMAL_IPAR_INTPNT_MAX_ITERATIONS", 500) (any PRIMAL_IPAR_* / PRIMAL_DPAR_* of primal.h). Examples are in examples/julia/. To work on the package against a local C build, see julia/README.md.


r/Julia • • 3d ago

Numerical computing in my pocket

Post image
13 Upvotes

r/Julia • • 4d ago

I made a FD incompressible flow solver visualized in Makie.jl

1 Upvotes

r/Julia • • 4d ago

Potential Time to First X (TTFX) Improvements in v1.9

0 Upvotes

r/Julia • • 10d ago

Manopt.jl 1.0

30 Upvotes

Manopt.jl 1.0 is available now!

Read the full announcement at https://discourse.julialang.org/t/ann-manopt-jl-1-0/143187


r/Julia • • 11d ago

UlmBLAS.jl: faster cholesky on many cores and a mul! for strided views (looking for benchmarks and critique)

40 Upvotes

I'm the author of ulmBLAS, a BLAS (Basic Linear Algebra Subprograms) library in readable C++ that I started in 2014 for my HPC (high-performance computing) lecture at Ulm University. It is now registred as a Julia package, UlmBLAS.jl, and I would like to hear what Julia users think about it.

The package does two things:

  1. UlmBLAS.forward() makes ulmBLAS the BLAS of Julia (through libblastrampoline). A * B, BLAS.gemm!, triangular solves and also lu and cholesky then go to ulmBLAS. The rest of LAPACK (Linear Algebra PACKage), e.g. qr and eigen, stays with OpenBLAS. Just using UlmBLAS doesn't change anything.
  2. UlmBLAS.mul!(C, A, B) works for matrices with arbitrary strides, e.g. A = view(P, 1:2:1000, :), without copies. It also multiplies Int8/UInt8 into Int32 and Float16/BFloat16 into Float32, where Julia uses generic loops. On one core of an M5 with n = 1024: Int8 3447 instead of 33 G op/s, Float16 1645 instead of 13.

Some numbers for cholesky! with n = 4000 on all cores, against Julia's OpenBLAS: 1.68x on an Apple M5, 1.77x on a 64-core Ice Lake, 1.80x on a 96-core Zen 4, 1.11x on a 6-core i5-12500. On one thread the M5 is at 3.85x, becuase ulmBLAS has its own kernels for the SME2 (Scalable Matrix Extension 2) matrix unit of the M4/M5. Its not ahead everywhere: for n ≤ 200 it is mostly behind, and on one thread on the i5-12500 too. The full tables, also the bad ones, are in the README.

How it works: ulmBLAS includes the micro kernels of BLIS (BLAS-like Library Instantiation Software) and OpenBLAS plus a few own ones, and it selects them at run time, depending on the machine and on the problem size. Level 3 runs on an own thread pool, and LU (lower-upper) and Cholesky use tasks like PLASMA (Parallel Linear Algebra Software for Multicore Architectures), but in place, without to copy the whole matrix.

Installation is just Pkg.add("UlmBLAS") (Julia 1.10 or later). There are prebuilt libraries for macOS on Apple silicon and for Linux and Windows on x86-64, and the package loads the one that fits the processor.

What would help me most are benchmark results from machnies I don't have. The script is bench/potrf.jl in the UlmBLAS.jl repo (how to run it is at the top), and the results I have so far are in bench/results. Critique is welcome too, also of the API.

https://github.com/michael-lehn/UlmBLAS.jl

https://github.com/michael-lehn/ulmBLAS


r/Julia • • 18d ago

Obfuscating & protecting compiled code

13 Upvotes

Hi All,

I'm about to release some closed source software written in Julia with a bit of C++. I'm concerned about every other application getting reversed engineered/ decompiled overnight by LLMs. I'm doing what I can to prevent it, both technically and in contracts with clients however I'm looking for further advice.

Has anyone got any tips or recommendations to protect and minimise the risk of decompiling my Julia codebase?

I'm currently using PackageCompiler, stripping all IR, metadata and symbols, obfuscating strings, and DLL integrity checks to ensure nothing has been modified.

Appreciate any and all advice.


r/Julia • • 20d ago

Which is better design for making a graph

12 Upvotes

Hi there. I am creating Jetelina, please ref here what it is and use plotly.js to create some analyzing graphics: access numbers, API execution speed, ...
The basic rule in Jetelina is to separate the front and the back as much as I can. So, graphics are created by receiving data from backend Julia programs. The below is the API execution speed data graph. I think it can be cooler. I am wondering if it will be the best if Jetelina hires a backend process to create a graph by using Makie.jl, Plots.jl and so on, even if I break the basic rule on Jetelina.
Any advice is appreciated from your experiences.


r/Julia • • 22d ago

Tsit5 stepped over a kink in my ODE and returned Success with the wrong answer. dtmax or a callback?

10 Upvotes

A few weeks ago I asked here about a Julia simulator for small off-grid villages. One piece of it is a plain ODE with four stocks: a battery, a water tank, a food store, a compute buffer. Each flow is clipped with min/max so nothing can take out more than a stock holds or put in more than fits. That makes the right-hand side continuous, but with a bend a little below capacity, where the cap on inflow starts to bite.

On one day the battery should have charged up to full. Instead it went down, even though there was more sun than demand, and ended at 2814.6 kWh instead of 3000, with retcode Success. As far as I can tell, while the battery charges at a steady rate the solution is a straight line, the error estimate is close to zero, and Tsit5 keeps stretching the step until one step covers most of the day. That step starts below the bend and its later stages land past full, where inflow is cut off, so it pulls the battery down and the error estimate doesn't notice.

Here's the day on its own:

using OrdinaryDiffEq   # wrong on OrdinaryDiffEq 7.8.1; on 6.107.0 + OrdinaryDiffEqCore 3.1.0 this day is fine (other days fail there)
τ = 0.05   # days over which a stock can fill or empty at its bounds
caps = [3000.0, 3e5, 9e7, 7200.0]; ins = [1821.6416596454678, 6e4, 9e5, 3600.0]
dems = [1500.0, 45000.0, 750000.0, 2400.0]; loss = [0.001, 0.002, 0.0005, 0.0]
function rate(u, cap, in, dem)
    out = max(0.0, min(dem, in + u/τ))                 # can't take out more than there is
    return max(0.0, min(in, out + (cap - u)/τ)) - out  # can't put in more than fits
end
f!(du, u, p, t) = (du .= rate.(u, caps, ins, dems .+ loss .* max.(0.0, u)))   # in-place; out-of-place passes on this day
u0 = [2854.0445204092402, 299999.9999999993, 7.775874075072253e7, 7199.999999999989]   # every digit matters: 3e5 for the tank passes
sol = solve(ODEProblem(f!, u0, (0.0, 1.0)), Tsit5(); reltol=1e-6, abstol=1e-6)
println(sol.retcode, ", battery at end of day: ", sol.u[end][1])   # should be ~3000

This day is right on the edge, though. Change the last digit of the tank's start value, or write f as out-of-place, and this day comes out at 3000 while some other day in the batch goes wrong instead. The 2814.6 comes from a Mac with an Apple chip (aarch64), while the same code under x86 emulation (Rosetta) gives 3000, and I haven't tried it on a native x86 machine or worked out why it changes (fused multiply-add is my only suspect so far). Across my whole batch it's 9 days out of about 1.2 million, so if you run it and get 3000, that's expected and doesn't mean it's fixed.

I tried two fixes. Capping dtmax at τ fixes that day and held up across a big batch of runs, but it roughly triples the steps over a simulated year. A ContinuousCallback on each bend, with an empty affect! that only makes the step stop there and no dtmax, also fixes that day and costs about the same as doing nothing. But in the bigger batch it still misses a few days, some about as badly as no fix at all. On the days I looked at, the bend condition had the same sign at the start and at the end of the long step.

So is dtmax the right answer for a right-hand side like this, or is there a better way to tell the solver where the bends are when I don't know ahead of time when a stock will hit them? I'm not sure whether that's a bug, a known limit of error control on non-smooth problems, or just me using the solver wrong.


r/Julia • • Nov 04 '26

What are people building beyond conventional LLM agent architectures?

24 Upvotes

I'm working on a Julia-based AI system with its own behavioral processing, persistent state and dynamic code-generation capabilities. It can generate new Julia functions and incorporate them into its available execution tools.

I'm interested in what else is being developed in this space, particularly architectures that combine behavioral systems with dynamic execution.

I'd like to compare approaches and hear some serious technical perspectives.


r/Julia • • Oct 31 '26

How do I get around this "juliaup needs to modify a number of files?"

10 Upvotes

I do have (a version of) julia and it is running on my windows system. But on my mac, I tried to "upgrade" to the latest version. And it seems to be stuck on this needing to modify thing. Is there a simple solution? Thanks


r/Julia • • Oct 29 '26

What are the advantages by using Julia rather than R or Python?

70 Upvotes

More often than not, at work, we are encouraged to create data analysis dashboards using a programming language. Some of my friends have suggested that I use Julia instead of R or Python. Can its libraries, similar to tidyverse in R or pandas in Python, be used to create innovative, useful, and aesthetically pleasing visualizations? What are its advantages? Excuse my ignorance

Thanks in advance!!!


r/Julia • • Oct 28 '26

Help needed in migrating from MATLAB project to Julia

25 Upvotes

Currently, I have a large repository of MATLAB code related to some Radar processing (https://github.com/roopeshor/Radar-Signal-Processing ). I want to try out how Julia performs in this task. However, the current architecture classifies functions into different folders. In MATLAB, a function in a folder +a/fx.m can be simply accessed with a.fx() anywhere within the folder. However replicating such a system was extremely difficult for me due to the import system. My current idea is to organize each folder into modules and then link them all in one large module. But that approach failed. My situation is following:

  • io/reader.m uses struct definition in structs/Data.jl (which was actually a classdef in MATLAB)
  • struct/Obs.jl uses reader function from io/reader.m.
  • functions in algo folder uses struct/Obs.jl.
  • All functions in algo folder need to be packaged in single module algo.
  • All functions in io need to be packaged in single module io

Is there some way to organize the code similar to Matlab? Current implementation with hierarchical organization tends to produce either cyclic dependencies or double import.

I dont know if its a big ask, But any help is appreciated.

Update:

With suggestions from you, I changed some parts of code, now its more cleaner. I decided to not use inheritance. With help of chatGPT and few hours of debugging I got a working code. Thank you


r/Julia • • Oct 26 '26

How to make a GUI in Julia? Recommendations?

37 Upvotes

Hi I'm making a package for visualization and analysis of computational chemistry results. I need interactive graphs that allow me to select atoms, highlight bonds, etc, and toggle visualization options using buttons or sliders. I don't have experience making a GUI, although I managed to make a composite figure with a slider and observables that allow me to switch structures from a trajectory file. But don't know how to go beyond that to an acceptable GUI. Any advice on where to get started is appreciated!! Thank you!!


r/Julia • • Oct 24 '26

Building an open-source survival simulator in Julia: How do you model equipment wear-and-tear alongside daily energy use?

23 Upvotes

We're building an open-source simulator in Julia to stress-test off-grid community designs (solar arrays, water storage, heating) before spending real money on physical hardware.

The part I'm scratching my head over is handling wear and tear.

Daily energy and water use are smooth, continuous flows, and DifferentialEquations.jl handles that part smoothly. But real hardware doesn't degrade smoothly. Inverters overheat and pop, water pumps seize up after 3,000 operating hours, and someone forgets to clean a filter.

If you've built multi-year simulations in Julia, what's the cleanest way to trigger sudden mechanical breakdowns based on accumulated usage hours without slowing down the continuous ODE solver?

Keeping it simple and modular is key. Are there any good patterns or packages you'd recommend for coupling discrete stochastic events with continuous stock-flow equations?


r/Julia • • Oct 22 '26

The Julia programming language repository summary

Post image
7 Upvotes

r/Julia • • Oct 17 '26

PerfChecker.jl tutorial series: benchmarking, profiling, and reproducible performance checks in Julia

27 Upvotes

Hi everyone!

I work on PerfChecker.jl, a Julia package for running repeatable performance checks and comparing results across implementations or package versions.

You define the operation to measure and how to verify its correctness. PerfChecker coordinates benchmarking, profiling and analysis tools—including BenchmarkTools, Profile.Allocs and JET—and saves the results for inspection, comparison and sharing. You can use it to investigate performance problems and prepare regression checks for CI.

I’ve put together an English tutorial series with an introduction and five chapters covering:

  • Installation and a first run.
  • Benchmarks, profiles and analysis tools: what they’re useful for and how to interpret their output.
  • Reproducible suites, correctness checks and CI configuration.
  • VS Code, terminal, Web and Pluto interfaces, plus exporting and sharing results.
  • MCP advice, reviewed code changes and bounded investigations.

The walkthroughs use real interfaces and recorded results. The emphasis is on understanding what each tool tells you and choosing a useful next step.

YouTube playlist

Source code and issues

I’d appreciate feedback on getting started, interpreting results, and workloads you’d like to see covered. Questions, bug reports, documentation improvements and contributions are all welcome.

Thanks to the Julia community and the maintainers of the tools PerfChecker brings together!


r/Julia • • Oct 16 '26

I accidentally a Julia-based inference engine that can run Qwen3.8-27B

30 Upvotes

(There's more to Luminal.jl than this, see the github link for more, but this post focuses on running Qwen3.8-27B)

Serve Qwen3.8-27B (GGUF)

examples/qwen35_server.jl serves a Qwen3.5 / 3.6 / 3.8 GGUF through an OpenAI-compatible API (streaming chat completions, tool calls, reasoning content), for harnesses such as opencode. Weights stay in the GGUF's own quantization on the GPU (LUMINAL_GGUF_NATIVE=1; Q4_K_XL, about 17 GB), and the model's MTP head drafts tokens for speculative decoding.

LUMINAL_GGUF_NATIVE=1 julia -t auto,1 --project=. examples/qwen35_server.jl \
    /path/to/Qwen3.8-27B-UD-Q4_K_XL.gguf --max-seq=262144 --port=8080
  • Use -t auto,1: the server needs the extra interactive thread. The HTTP tasks run on the main thread and the GPU work in a task pinned to another one; without that, nothing is streamed while a prefill or a decode step blocks the main thread.
  • The first start takes a few minutes (reading the GGUF, compiling the graphs). The log prints serving ... when it is ready.
  • --max-seq sets the context and the KV cache allocated up front (Float16, 64 KB per token: 17 GB at 262144). Other flags: --mtp=<gguf> (a separate file with the MTP head), --host, --name (the model id), --no-spec, --int8.
  • Point the client at http://127.0.0.1:8080/v1 (GET /v1/models, GET /health, POST /v1/chat/completions). For opencode, add an @ai-sdk/openai-compatible provider with that baseURL and the --name as the model id. Long prompts can take minutes before the first token, so raise or disable its request timeouts.
  • --reasoning-budget=N limits the thinking: after N reasoning tokens the server closes the <think> block with a short wrap-up and the model answers from what it has (the resume costs a re-prefill of the new turn, about 10-20 s at N = 4096). A request overrides it with thinking_budget (also thinking.budget_tokens, reasoning_budget; 0 = no limit). In opencode, put "thinking_budget": N in the model's options.
  • Prompts are cached: the system prompt, each turn, and state checkpoints every 4096 tokens (LUMINAL_CKPT_EVERY), so a follow-up turn reprocesses only its new tokens. A cold prefill runs at 330-480 tok/s (about 3 minutes for 75k tokens); a warm turn answers in 3-25 s. Decode is 11-15 tok/s at 70-130k tokens of context (2.3-2.9 tokens per speculation cycle).
  • It handles one request at a time, and it needs about 35-60 GB of unified memory at the largest context, depending on how many prompts are cached. The log reports prompt processing, generation speed and speculation per request.

For a one-shot generation from a GGUF, examples/qwen35_gguf.jl <file.gguf> "prompt".

https://github.com/philtomson/Luminal.jl

NOTE: right now I'm only sure that this works well on AMD Strix Halo GPUs. It might work on Nvidia GPUs via CUDA.jl, but I have not tested it.


r/Julia • • Oct 16 '26

How I did Molecular dynamics on a peptide with my own code

Thumbnail youtu.be
21 Upvotes

This video shows how my molecular dynamics code is composed, and what functionality it has so far. There is also the link to GitHub to download the current version of the code, which requires Molly.jl, Chemfiles.jl and EzXML.jl

If you try the code please leave any suggestions and bugs you find here, in YouTube or in the GitHub repo.


r/Julia • • Oct 13 '26

Necro-Matcher - Early Access Trailer (A game written in Julia)

Thumbnail youtube.com
37 Upvotes

We are launching our demo for the steam next fest now! Visit: Necro-Matcher on Steam to download and play!
I haven't posted about this on reddit yet, so here's some context: https://discourse.julialang.org/t/im-creating-the-worlds-first-commercial-game-written-in-julia


r/Julia • • Oct 13 '26

October Headline: Julia Returns to the TIOBE Top 20

Thumbnail tiobe.com
71 Upvotes

r/Julia • • Oct 12 '26

Calculus with Julia

Thumbnail jverzani.github.io
43 Upvotes

r/Julia • • Oct 11 '26

Contact mechanics in Julia, directly from the weak form

Thumbnail gallery
48 Upvotes

I've been working on contact mechanics in LowLevelFEM.jl and wanted to share a small 2D Hertz-type contact example.

One of my goals is to keep the implementation as close as possible to the mathematical weak form.

For example, the penalty contact stiffness is simply:

G = ContactGap(C)
Kc = ∫(G ⋅ cn ⋅ G; updateFrom=u)

The same contact operator can also be used in a Lagrange-multiplier formulation:

B = ∫(Λ ⋅ ContactGap(C, active=:all))

The figures show the resulting contact pressure, normal gap, and von Mises stress distribution.

The implementation handles closest-point contact detection at Gauss points and currently supports both 2D and 3D problems. I've also been working on multithreaded sparse assembly and lightweight geometry updates to reduce the cost of nonlinear iterations.

It's still a work in progress, particularly for more advanced contact laws, but the basic framework seems promising.

I'm curious how others working with FEM in Julia approach contact mechanics, especially the balance between a readable weak-form formulation and efficient contact search and assembly.