leaatimberini/GRETA-N-engine

0

stars

0

commits

Python

primary language

Jan 4, 2026

updated

README

GRETA N-ENGINE v1.0 (Turing Complete)

GRETA N-ENGINE

Hardware-Native AI Inference Engine for NVIDIA Ada Lovelace (RTX 4090)

License: Apache 2.0 Architecture: Ada Lovelace Status: Beta

🇪🇸 Versión en Español


🚀 Overview

GRETA N-ENGINE is a specialized inference runtime built from scratch to maximize the performance of consumer hardware (specifically the RTX 4090), rejecting standard abstractions like PyTorch or TensorFlow at runtime.

By implementing custom CUDA kernels fused specifically for the SM89 architecture and managing memory through a "Holographic" virtual addressing system, GRETA achieves higher throughput and lower latency for Large Language Models (LLM) compared to generic frameworks.

Key Features

  • Sovereign Memory Protocol: Direct "Zero-Copy" Pinned Memory architecture (cudaHostAllocMapped), bypassing CUDA Unified Memory for absolute read/write coherence between Host and Persistent Kernels.
  • Standard Launch: Kernel execution compatible with Docker/Containers without privileged flags (<<<1, 1024>>> block design).
  • Holographic Memory: Single-shot VRAM allocation with virtual addressing (0 overhead malloc).
  • Static Isochronous Scheduler: Persistent execution kernel ("Heartbeat") replacing the CUDA driver dispatch.
  • Turing Complete G-ASM: GPU-resident control flow executing entirely on-chip.
  • Validated Inference Quality: Coherent token generation verified on real hardware (RTX 4090).
  • HiveMind: Automatic failure detection (silence, loops) with external Oracle correction.

🛠️ Architecture

The engine is composed of four sovereign layers:

  1. Holographic Memory (Layer 0): Virtual memory manager.
  2. Sovereign Scheduler (Layer 1): Persistent execution kernel with direct PCIe mapped memory.
  3. Fused Kernels (Layer 2): Hand-written CUDA kernels (Attention+RoPE, GEMM+RMSNorm).
  4. Graph Engine (Layer 3): Static command compiler.

For detailed architecture, see WHITE_PAPER.md.


⚡ Quick Start

Requirements

  • Hardware: NVIDIA RTX 4090 (Ada Lovelace, sm_89).
  • Drivers: CUDA 12.x+
  • OS: Linux (tested on Ubuntu 22.04).

Chat Demo (Interactive)

The chat.py tool provides a full interactive shell with automatic VRAM cleanup.

# 1. Compile the Engine
./compile_gvm.sh

# 2. Run the Chat (Auto-loads xLAM-7b-r)
python3 tools/chat.py

🌐 API Server

Run the FastAPI server for REST API access:

# Install dependencies
pip install fastapi uvicorn transformers

# Start the API server
python3 tools/api_server.py

Endpoints:

  • GET /health: Check GVM status.
  • POST /chat: Send {"prompt": "...", "max_tokens": 512}, receive {"response": "...", "tokens_generated": N}.

📚 Documentation


📜 License

Apache 2.0

GRETA N-ENGINE Project by L.E.T

leaatimberini/GRETA-N-engine

0

stars

0

commits

Python

primary language

Jan 4, 2026

updated

README

GRETA N-ENGINE v1.0 (Turing Complete)

GRETA N-ENGINE

Hardware-Native AI Inference Engine for NVIDIA Ada Lovelace (RTX 4090)

License: Apache 2.0 Architecture: Ada Lovelace Status: Beta

🇪🇸 Versión en Español


🚀 Overview

GRETA N-ENGINE is a specialized inference runtime built from scratch to maximize the performance of consumer hardware (specifically the RTX 4090), rejecting standard abstractions like PyTorch or TensorFlow at runtime.

By implementing custom CUDA kernels fused specifically for the SM89 architecture and managing memory through a "Holographic" virtual addressing system, GRETA achieves higher throughput and lower latency for Large Language Models (LLM) compared to generic frameworks.

Key Features

  • Sovereign Memory Protocol: Direct "Zero-Copy" Pinned Memory architecture (cudaHostAllocMapped), bypassing CUDA Unified Memory for absolute read/write coherence between Host and Persistent Kernels.
  • Standard Launch: Kernel execution compatible with Docker/Containers without privileged flags (<<<1, 1024>>> block design).
  • Holographic Memory: Single-shot VRAM allocation with virtual addressing (0 overhead malloc).
  • Static Isochronous Scheduler: Persistent execution kernel ("Heartbeat") replacing the CUDA driver dispatch.
  • Turing Complete G-ASM: GPU-resident control flow executing entirely on-chip.
  • Validated Inference Quality: Coherent token generation verified on real hardware (RTX 4090).
  • HiveMind: Automatic failure detection (silence, loops) with external Oracle correction.

🛠️ Architecture

The engine is composed of four sovereign layers:

  1. Holographic Memory (Layer 0): Virtual memory manager.
  2. Sovereign Scheduler (Layer 1): Persistent execution kernel with direct PCIe mapped memory.
  3. Fused Kernels (Layer 2): Hand-written CUDA kernels (Attention+RoPE, GEMM+RMSNorm).
  4. Graph Engine (Layer 3): Static command compiler.

For detailed architecture, see WHITE_PAPER.md.


⚡ Quick Start

Requirements

  • Hardware: NVIDIA RTX 4090 (Ada Lovelace, sm_89).
  • Drivers: CUDA 12.x+
  • OS: Linux (tested on Ubuntu 22.04).

Chat Demo (Interactive)

The chat.py tool provides a full interactive shell with automatic VRAM cleanup.

# 1. Compile the Engine
./compile_gvm.sh

# 2. Run the Chat (Auto-loads xLAM-7b-r)
python3 tools/chat.py

🌐 API Server

Run the FastAPI server for REST API access:

# Install dependencies
pip install fastapi uvicorn transformers

# Start the API server
python3 tools/api_server.py

Endpoints:

  • GET /health: Check GVM status.
  • POST /chat: Send {"prompt": "...", "max_tokens": 512}, receive {"response": "...", "tokens_generated": N}.

📚 Documentation


📜 License

Apache 2.0

GRETA N-ENGINE Project by L.E.T

Languages

Python

59.4%

Cuda

22.4%

C++

15.7%

Shell

2.1%