whatisgithub

What is egregore-core-jax?

pjhkorea/egregore-core-jax — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · developerComplexity · 4/5LicenseSetup · moderate

In one sentence

egregore-core-jax is a set of low-level JAX utility modules that replace conditional branches with algebraic masking for faster, more numerically stable XLA-compiled deep learning code.

Mindmap

mindmap
  root((egregore-core-jax))
    What it does
      Branchless JAX kernels
      Numerical stability guards
      Shape-safe reshaping
    Tech stack
      Python
      JAX
      XLA
    Modules
      optimizers.py
      geometry.py
      math_guardrails.py
    Audience
      JAX engineers
      Deep learning researchers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Apply layer-wise learning rate decay to a JAX model without introducing conditional branches that break XLA compilation.

USE CASE 2

Reshape and reduce tensors of varying dimensions in JAX without triggering ConcretizationTypeError shape-tracing crashes.

USE CASE 3

Guard transcendental functions like arccos against NaN explosions near their numerical boundaries while preserving gradients.

USE CASE 4

Study branchless, masking-based patterns for writing XLA-friendly JAX code.

What is it built with?

PythonJAXXLA

How does it compare?

pjhkorea/egregore-core-jax0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity4/54/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Assumes familiarity with JAX/XLA compilation internals, not written for JAX beginners.

Permissive open-source license, free to use, modify, and redistribute, including commercially.

So what is it?

egregore-core-jax is a small collection of Python utility modules for people building deep learning models with JAX, a numerical computing library that compiles code to run efficiently on GPUs and TPUs. The project focuses on a specific kind of performance problem: ordinary conditional logic, if this then that, can slow down JAX programs because it interrupts the compiler's ability to fuse operations into fast, uninterrupted chunks of hardware instructions. Each module in this repository replaces that kind of conditional logic with pure arithmetic instead. The first module, optimizers.py, helps apply different learning rates to different layers of a model, a common technique called layer-wise learning rate decay. Rather than checking each parameter's name against a list of rules with if statements, it turns those checks into numeric masks that get multiplied against the parameters directly, which keeps the whole operation compiling into a single fast unit instead of many small conditional steps. The second module, geometry.py, deals with a common annoyance in JAX: code that reshapes tensors of varying dimensions can trigger confusing compiler errors when the shape changes unexpectedly during tracing. This module locks certain shape related arguments as fixed constants at compile time, so tensors of different shapes, such as a plain batch of vectors or a batch of sequences, can be reshaped and reduced using the same underlying fast code path without triggering those errors. The third module, math_guardrails.py, protects against a numerical stability problem: some math functions, such as arccos, produce invalid results or break gradient calculations when their input gets too close to certain boundary values. This module keeps inputs within a safe range while still allowing a small gradient signal to pass through at the edges, so that training does not stall out completely. Overall this is a low level performance toolkit aimed at engineers already comfortable with JAX internals, gradient computation, and hardware compiler behavior, rather than a general purpose library for beginners. The code is released under the Apache License 2.0, which allows free use, modification, and commercial redistribution.

Copy-paste prompts

Prompt 1
Show me how to use egregore-core-jax's optimizers.py to set up layer-wise learning rate decay for my JAX model.
Prompt 2
Explain how geometry.py avoids ConcretizationTypeError when reshaping batches of different dimensions in JAX.
Prompt 3
How does math_guardrails.py keep arccos from producing NaN near plus or minus one while preserving gradients?
Prompt 4
Walk me through why replacing if/else branches with float32 masks helps XLA fuse kernels.

Frequently asked questions

What is egregore-core-jax?

egregore-core-jax is a set of low-level JAX utility modules that replace conditional branches with algebraic masking for faster, more numerically stable XLA-compiled deep learning code.

What language is egregore-core-jax written in?

Mainly Python. The stack also includes Python, JAX, XLA.

What license does egregore-core-jax use?

Permissive open-source license, free to use, modify, and redistribute, including commercially.

How hard is egregore-core-jax to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is egregore-core-jax for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.