Skip to content

ScaleFree-Tech/yishape-math-gpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YiShape Math GPU

Java License

Overview

YiShape Math GPU (yishape-math-gpu) is the GPU compute bridge for YiShape Math. It provides GPU-accelerated numerical computation via wgpu shaders, called from Java through the FFM (Foreign Function & Memory) API.

Part of the four-tier fallback chain: GPU → HPC → SIMD → SISD.

Supported Operations

GPU-accelerated ops include: add, sub, mul, div, neg, abs, sqrt, exp, log, pow, sin, cos, tanh, sigmoid, relu, gelu, dot, mean, sum, powSum, and more — covering the autodiff compute graph.

Requirements

  • Java 25+ (requires FFM API)
  • Maven 3.6+
  • JVM argument: --enable-native-access=ALL-UNNAMED

Maven Coordinates

<dependency>
    <groupId>com.yishape.lab</groupId>
    <artifactId>yishape-math-gpu</artifactId>
    <version>0.5.0</version>
</dependency>

Prebuilt JAR is also available in the yishape-math repo libs/ directory.

From GitHub Packages

Configure github-gpu in ~/.m2/settings.xml (PAT with read:packages):

<repositories>
  <repository>
    <id>github-gpu</id>
    <url>https://maven.pkg.github.com/ScaleFree-Tech/yishape-math-gpu</url>
  </repository>
</repositories>

Build from Source

No GitHub account required — just JDK 25. The libs/ directory contains prebuilt native libraries for all supported platforms; no Rust toolchain is needed:

git clone https://github.com/ScaleFree-Tech/yishape-math-gpu.git
cd yishape-math-gpu
./mvnw install -DskipTests -DskipNativeBuild=true

Usage

The GPU backend is auto-detected at runtime. Control it via:

GpuSwitch.enable();   // Enable GPU
GpuSwitch.disable();  // Disable GPU (fall back to HPC/SIMD/SISD)

Or via system property: -Dyishape.gpu=true|false

License

Apache License 2.0 — see LICENSE for details.

About

GPU support for yishape-math

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages