Skip to content
quatrixonePublic

About

Experimental native HIP compute for PS5: compiler, runtime, ROCm libraries, inference and training research.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ps5-hip

An experimental native HIP compute platform for PlayStation 5 homebrew.

First release: native LLM inference. The active v1 plan targets one small Llama-family model, GGUF Q4_0, batch one and a 512-token context through a standalone PS5 HIP client. Short native generation now passes on .40: TinyLlama 1.1B generates four tokens using live feedback and repeats after reset. All 384 captured layer/norm/logit outputs across 16 decoder commits match the CPU oracle bitwise, with clean native teardown. Diagnostic decode timings include readback and file writes; throughput is not qualified. Wider prompts/context, remaining numerical fixtures and release qualification are still open. Training, broad frameworks and general SDK expansion remain later goals.

The ambition is to make the PS5 a programmable GPU compute machine: compile real HIP C++ kernels, reuse useful ROCm libraries, support standalone inference clients, and ultimately run native PyTorch inference and training.

Status: a bounded native HIP runtime now executes genuine compiler-registered clients on PS5 firmware 12.70. G3/G4 remain incomplete; frameworks and application integration are still planned. The reusable client passed eleven blocking launches through two kernels, with exact results and complete compiler/runtime cleanup. The corrected math fixture passed 1,542 values under an unchanged numerical contract. The tiled matrix client passed eight launches and 982 exact outputs across four shapes using combined 2D geometry and static LDS. An unedited HIPIFY translation also passed six native launches and 662 exact unsigned sums with complete cleanup. This qualifies that ordinary CUDA source example, not general CUDA compatibility. The CPU threading proof passed two joined workers, isolated thread-local values and synchronization cleanup on the console. Concurrent HIP calls and GPU access from worker threads remain unqualified. The runtime currently requires serialized host calls; unsupported features fail explicitly. See current state for the latest candidate and its exact limits.

The earlier G2 milestone checked 292 exact values over two clean cycles of one image, with unchanged guards and title teardown. The G2 acceptance record maps all six requirements to the exact gfx1013, wave32, 1D arithmetic fixture. Mount checks establish unchanged visible title records; persistent registration is expected. The first GPU candidate faulted on a CPU import boundary. Changing only the sceAgcSuspendPoint provider produced the successful run. See the execution receipt and the fault analysis. A later title cycle passed two vector dispatches through one queue: vector evidence. Host tests and exact-candidate sanitizer checks support the qualified subset; general compute semantics and framework compatibility remain unqualified. The G1 acceptance receipt records each requirement, selected LLVM 18 route, TheRock comparison and remaining limits. The repository is private.

Start here

For a fresh WSL/Linux checkout, install Python 3, GNU Make, CMake, Ninja, LLVM/LLD 18.1.8 and .NET SDK 10.0.112, then run make to fetch the locked public dependencies, run host tests, cross-compile the native core, and build the 76-object public HIP bootstrap package offline. Set RESULTS_DIR to the intended console results path. ProsperoEden and ps5-homebrew-dev-protocol are snapshots of their public main branches; no unpublished dependency branch is needed. See the source-only build for outputs and the distinction between a new package and the image already installed.

What success looks like

  1. A native PS5 application executes independently compiled HIP kernels with verified arithmetic, memory, synchronization and register-spill behavior.
  2. Developers build useful HIP applications against a documented PS5 SDK, with supported operations working and unsupported operations failing explicitly.
  3. Selected ROCm libraries and standalone inference clients use the runtime successfully, with measured correctness, performance and memory use against existing implementations.
  4. Native PyTorch performs inference, backward propagation, optimizer steps and checkpoint/resume on the console. Small-model training and bounded LoRA experiments provide real applications of that capability.

The later goals explore on-console compilation, graph compilers and collaboration between multiple consoles. These are planned research directions, not capabilities.

Standalone SDK scope

This repository owns the reusable compute runtime, compiler configuration, library integration and validation. G7 delivers a standalone ggml/llama inference client and a reproducible SDK preview. ProsperoAI integration is out of scope. Historical application research remains provenance, not an integration requirement. Benchmark controls must use pinned, matched workloads and qualified backends.

Technical direction

Start with device code compiled on a development PC, a bounded AMDGPU code-object loader, and the existing native PS5 GPU submission and memory mechanisms. Prove that boundary before choosing how much upstream HIP/CLR/ROCr machinery to reuse. TheRock supplies reproducible component builds where useful; it is not a PS5 driver or a substitute for validating the console's execution model.

The GPU requires a measured capability profile. Existing PS5 Mesa findings show that accepting GFX10.3 shader code does not establish full desktop gfx1030 compatibility. Compiler targets, dot products, wave state and scratch behavior must be qualified explicitly.

Scope and provenance

This is independent homebrew research for owner-controlled, compatible consoles. No model weights, credentials, proprietary SDK components, firmware or system module dumps belong in this repository. Dependencies retain their licenses and will be pinned and attributed before incorporation. No project-wide code license has been selected yet.

Repository creation and this plan do not authorize an automatic console launch. Hardware execution follows the owner's current environment authorization and the native development protocol described in the plan.

About

Experimental native HIP compute for PS5: compiler, runtime, ROCm libraries, inference and training research.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages