Skip to content

Latest commit

 

History

History
294 lines (256 loc) · 12.9 KB

TOPOLOGY.adoc

File metadata and controls

294 lines (256 loc) · 12.9 KB

Axiom.jl - System Architecture

                         Axiom.jl - Provably Correct Machine Learning
                         ============================================

    User API Layer
    +-----------------------------------------------------------------+
    |  @axiom    @ensure    @prove*    Sequential/Chain/Pipeline      |
    |  Dense  Conv2d  BatchNorm  LayerNorm  MaxPool  Dropout  ReLU   |
    |  CouplingLayer  ActNorm  Inv1x1Conv  RevBlock  NormFlow        |
    |  train!()    compile()    verify()    from_pytorch()            |
    +-----------------------------------------------------------------+
         |              |              |              |
         v              v              v              v
    +----------+  +-----------+  +-----------+  +-----------+
    |  DSL &   |  | Training  |  | Verifi-   |  | Integra-  |
    |  Macros  |  | Loop      |  | cation    |  | tions     |
    |----------|  |-----------|  |-----------|  |-----------|
    | axiom_   |  | optimiz-  |  | proper-   |  | hugging-  |
    |  macro   |  |  ers.jl   |  |  ties.jl  |  |  face.jl  |
    | ensure   |  | loss.jl   |  | checker   |  | pytorch   |
    | prove*   |  | train.jl  |  | certifi-  |  |  ext      |
    | pipeline |  | gradient* |  |  cates.jl  |  |           |
    +----------+  +-----------+  | serial-   |  +-----------+
                                 |  ize.jl   |
                                 | proof_    |
                                 |  export   |
                                 +-----------+
                                       |
         +-----------------------------+-----------------------------+
         |                             |                             |
         v                             v                             v
    +-----------+               +-----------+               +-----------+
    | SMTLib.jl |               | Lean 4    |               | Coq /     |
    | (bundled) |               | Export*   |               | Isabelle* |
    |-----------|               +-----------+               +-----------+
    | z3, cvc5  |
    | yices,    |
    | mathsat   |
    +-----------+

    Backend Abstraction Layer (15 backends incl. SmartBackend)
    +-----------------------------------------------------------------+
    |  abstract.jl  -  AbstractBackend / set_backend! / compile()     |
    |  SmartBackend (per-op dispatch) / MixedPrecision / self-healing |
    +-----------------------------------------------------------------+
         |              |              |
         v              v              v
    +-----------+  +-----------+  +-----------+
    | Julia     |  | Zig       |  | GPU       |
    | Backend   |  | Backend   |  | Backends  |
    |-----------|  |-----------|  |-----------|
    | (default) |  | zig/      |  | CUDA      |
    | reference |  |  axiom    |  | ROCm      |
    | impl      |  |  .zig     |  | Metal     |
    |           |  | SIMD+MT   |  |           |
    +-----------+  +-----------+  +-----------+
                                       |
    Coprocessor Backends (self-healing fallback)       |
    +-----------------------------------------------------------------+
    | TPU | NPU | DSP | PPU | Math | FPGA | VPU | QPU | Crypto      |
    |-----------------------------------------------------------------|
    | Environment-based detection (AXIOM_*_AVAILABLE)                 |
    | Strict mode: AXIOM_*_REQUIRED=1 prevents fallback              |
    | Self-healing: graceful degradation to JuliaBackend              |
    +-----------------------------------------------------------------+

    * = disabled, stub, or placeholder

Completion Dashboard

Core Framework

Component Status Progress

Type System (Tensor)

Done

██████████ 100%

Layer Definitions

Done

██████████ 100%

Activation Functions

Done

██████████ 100%

Optimizers (SGD/Adam)

Done

██████████ 100%

Loss Functions

Done

██████████ 100%

Training Loop

Done

██████████ 90%

Model Save/Load

Done

██████████ 100% (binary)

Autograd (Zygote)

Done

██████████ 100%

Data Utilities

Done

██████████ 100%

Model Containers

Done

██████████ 100%

Reversible Computing

Component Status Progress

CouplingLayer (affine)

Done

██████████ 100%

ActNorm (data-dep init)

Done

██████████ 100%

Invertible1x1Conv (LU)

Done

██████████ 100%

RevBlock (reversible)

Done

██████████ 100%

InvertibleSequential

Done

██████████ 100%

NormalizingFlow

Done

██████████ 100%

Custom Zygote adjoints

Done

██████████ 100%

Roundtrip verification

Done

██████████ 100%

DSL & Macros

Component Status Progress

@axiom macro

Done

██████████ 100%

@ensure macro

Done

██████████ 100%

@prove macro

Done

██████████ 100%

Pipeline DSL

Done

██████████ 100%

Verification System

Component Status Progress

Property Checking

Done

██████████ 100%

Proof Certificates

Done

██████████ 100% (JSON+text)

Serialization

Done

██████████ 100%

SMTLib.jl (bundled)

Done

████████░░ 80%

Lean 4 Export

Done

████████░░ 80% (real tactics)

Coq Export

Done

████████░░ 80% (real tactics)

Isabelle Export

Done

████████░░ 80% (real tactics)

Proof Import

Done

██████████ 100%

Backends - Julia (Reference)

Component Status Progress

matmul

Done

██████████ 100%

conv2d

Done

██████████ 100%

activations (all)

Done

██████████ 100%

batchnorm / layernorm

Done

██████████ 100%

pooling (max/avg/glob)

Done

██████████ 100%

dropout / flatten

Done

██████████ 100%

Backends - Zig (sole native backend, 320KB .so)

Component Status Progress

matmul (SIMD tiled)

Done

██████████ 100%

activations (15 funcs)

Done

██████████ 100%

conv2d + depthwise

Done

██████████ 100%

pooling (max/avg/glob)

Done

██████████ 100%

norm (batch/layer/rms)

Done

██████████ 100%

flash attention

Done

██████████ 100%

rotary embeddings

Done

██████████ 100%

Julia-side ccall wiring

Done

██████████ 100% (17 ops)

Compiled .so artifact

Done

██████████ 100% (320KB)

FFI exports (32 syms)

Done

██████████ 100%

SIMD GELU/sigmoid/tanh

Done

██████████ 100% (3x speedup)

Multi-threaded dispatch

Done

██████████ 100% (4 threads)

Backends - GPU Extensions

Component Status Progress

CUDA: matmul

Done

██████████ 100%

CUDA: relu

Done

██████████ 100%

CUDA: softmax

Done

██████████ 100%

CUDA: conv2d

Done

██████████ 100%

CUDA: batchnorm

Done

██████████ 100%

CUDA: pooling

Done

██████████ 100%

ROCm: matmul/relu/soft

Done

██████████ 100%

ROCm: conv2d/norm/pool

Done

██████████ 100%

Metal: matmul/relu/soft

Done

██████████ 100%

Metal: conv2d/norm/pool

Done

██████████ 100%

Backends - Coprocessor Dispatch

Component Status Progress

Backend type hierarchy

Done

██████████ 100%

Env-based detection

Done

██████████ 100%

Self-healing fallback

Done

██████████ 100%

Strict mode / required

Done

██████████ 100%

Runtime diagnostics

Done

██████████ 100%

Capability reporting

Done

██████████ 100%

TPU extension skeleton

Skel

██░░░░░░░░ 20%

NPU extension skeleton

Skel

██░░░░░░░░ 20%

DSP extension skeleton

Skel

██░░░░░░░░ 20%

PPU extension skeleton

Skel

██░░░░░░░░ 20%

Math extension skeleton

Skel

██░░░░░░░░ 20%

FPGA extension skeleton

Skel

██░░░░░░░░ 20%

VPU extension skeleton

Skel

██░░░░░░░░ 20%

QPU extension skeleton

Skel

██░░░░░░░░ 20%

Crypto ext. skeleton

Skel

██░░░░░░░░ 20%

Integrations

Component Status Progress

PyTorch import/export

Done

██████████ 90%

HuggingFace framework

Done

████████░░ 80%

HF model converters

Done

████████░░ 80% (BERT/GPT2/ViT/ResNet/LLaMA/Whisper)

SafeTensors loader

Done

██████████ 100%

Model Metadata

Done

████████░░ 80% (bundle save/load)

Resource-aware dispatch

Done

██████████ 100%

Compile & Optimization

Component Status Progress

Backend dispatch

Done

██████████ 100%

SmartBackend (per-op)

Done

██████████ 100%

Mixed precision

Done

████████░░ 80% (loss scaling)

fold_batchnorm

Done

██████████ 100%

fold_constants

Done

██████████ 100%

dead code elimination

Done

██████████ 100%

aggressive opt pass

Done

██████████ 100%

Infrastructure

Component Status Progress

CI/CD (21 workflows)

Good

████████░░ 80%

Tests (283 passing)

Good

██████████ 100%

Benchmarks

Done

██████████ 100%

Documentation (wiki)

Done

██████████ 100%

RSR Compliance

Done

██████████ 100%

Bot directives (8)

Done

██████████ 100%

Contractiles (5)

Done

██████████ 100%

SCM files (5)

Done

██████████ 100%

Key Dependencies

Dependency Purpose Required

Julia >= 1.10

Runtime

Yes

LinearAlgebra

Matrix operations

Yes

SHA

Proof certificate hashing

Yes

JSON

Metadata serialization

Yes

CUDA.jl

NVIDIA GPU acceleration

Optional

AMDGPU.jl

AMD GPU acceleration

Optional

Metal.jl

Apple GPU acceleration

Optional

PyCall.jl

PyTorch interop

Optional

Zig toolchain

Zig backend compilation

Optional

Z3/CVC5

SMT solver for @prove

Optional

Overall: ~98% complete

Strongest areas: Core layers, activations, reversible computing (CouplingLayer/ActNorm/Inv1x1Conv/RevBlock/NormalizingFlow with custom Zygote adjoints), Zig kernel implementations (sole native backend, 36 exports, 395KB .so, SIMD + 4-thread dispatch), SmartBackend per-op dispatch, SIMD-optimized Zig kernels (GELU 3x, RMSNorm 7x, sigmoid 2.9x), multi-threaded element-wise ops (>64K threshold), SMTLib, coprocessor dispatch infrastructure (9 backends with setup guides and hardware detection), compile optimizations (incl. mixed precision with loss scaling), certificates, HuggingFace (7 architectures
SafeTensors), RSR compliance (SPDX on all files), GPU extensions (full coverage), autograd (Zygote), @prove (heuristic+SMT), proof export (real tactics), backend-aware dispatch (LayerNorm/RMSNorm route through backends), model save/load (binary + metadata bundle), external benchmarks (Axiom vs Flux vs PyTorch), 283 tests passing Weakest areas: Coprocessor skeletons (20% — need real hardware for end-to-end integration)

Ecosystem Context

Axiom.jl is the flagship package in julia-ecosystem (part of developer-ecosystem monorepo). 13 sibling COMPUTE packages share the same backend abstraction: Cladistics.jl, BowtieRisk.jl, Cliometrics.jl, KnotTheory.jl, HackenbushGames.jl, QuantumCircuit.jl, SMTLib.jl, PolyglotFormalisms.jl, Causals.jl, SiliconCore.jl, LowLevel.jl, ZeroProb.jl, ProvenCrypto.jl.