Skip to content
View NripeshN's full-sized avatar
🎯
Focusing
🎯
Focusing

Highlights

  • Pro

Organizations

@CrossGL

Block or report NripeshN

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
NripeshN/README.md

CrossGL logo

Hiya, I'm Nripesh.

I write compilers, mostly for GPU code. The main one is CrossTL, which translates shaders and compute kernels between CUDA, HIP, Metal, HLSL, GLSL, SPIR-V and Slang, and out to WGSL. I started it in 2024 and set up a small company around it, CrossGL. I'm in Sheffield, I moved here from Dubai for my master's.

This is the saxpy kernel from NVIDIA's intro to CUDA:

__global__
void saxpy(int n, float a, float *x, float *y)
{
  int i = blockIdx.x*blockDim.x + threadIdx.x;
  if (i < n) y[i] = a*x[i] + y[i];
}

and this is the Metal that crosstl translate saxpy.cu --backend metal writes for it:

#include <metal_stdlib>
using namespace metal;

// Constant Buffers
struct saxpy_Args {
  int n;
  float a;
};
// Compute Shader
kernel void kernel_saxpy(uint3 thread_position_in_grid
                         [[thread_position_in_grid]],
                         constant saxpy_Args &saxpy_Args [[buffer(4)]],
                         device float *x [[buffer(2)]],
                         device float *y [[buffer(3)]]) {
  int i = thread_position_in_grid.x;
  if (i < saxpy_Args.n) {
    y[i] = saxpy_Args.a * x[i] + y[i];
  }
}

Everything goes through CrossGL, a small IR in the middle, so adding a language means writing one frontend and one backend. If CrossTL can't translate something, it stops with an error that names the construct and the target. Every night CI runs thousands of generated tests through it and checks the output with each language's own compiler or validator.

CI coverage chart
CrossTL coverage chart from CI. For each language and direction it shows the share of generated feature tests where CrossTL's output is accepted by that language's own compiler or validator.

There's also a C++ compiler for CrossGL itself, which is still pretty early.

Open source

In 2023 I went round ML libraries telling them Macs have GPUs. The Apple Silicon (mps) support ended up in Transformers, PyTorch Lightning, DeepSpeed, PEFT, PyTorch Geometric, Kornia, Haystack, MMPreTrain, Raster Vision and, in August 2026, Ray.

In MLX I added some activation functions, Dropout3d, logical_and and logical_or, clip_grad_norm, cross and the orthogonal initialiser, and I'm on their acknowledgements list. I also started an experimental ROCm backend for it, which is still an open PR. I wrote the first version without an AMD GPU, so I found out it ran from someone else's screenshot in the thread.

Before CrossGL I was at Unify, first writing code for Ivy (41 merged PRs) and then running their open-source contributor programme.

Papers

Chess

MetalFish is my chess engine. It's basically Stockfish's search on the CPU and an Lc0-style transformer search on the GPU, looking at the same position at the same time. In practice it plays about as well as the Stockfish half does on its own. Its Lichess bot ran on my MacBook between May and July and drew 982 of its 1,207 games.

I play too, for Sheffield University in the Sheffield & District league, and I'm about 1700 FIDE. On Lichess my engine's bullet rating is about 1,450 points higher than mine😅

Chess position after 9.Ne5+ in a Vienna Gambit: white knights on d5 and e5, a white pawn on f6, the black king in check on f7. Black resigned. Chess position from black's side: the black queen on f2, protected by the bishop on e3, checkmates the white king on f1.
Me (white) against a 1900, nine moves into a Vienna Gambit. They resigned here. MetalFish (black) mating a 3059-rated bot.

nripesh14@gmail.com

Pinned Loading

  1. CrossGL/crosstl CrossGL/crosstl Public

    Translate GPU shaders and compute kernels between GLSL, HLSL, Metal, SPIR-V, Slang, CUDA and HIP, and to WGSL, through the CrossGL IR

    Python 2.4k 148

  2. MetalFish MetalFish Public

    GPU-accelerated Chess Engine

    C++ 2 1

  3. CrossGL/compiler CrossGL/compiler Public

    C++

  4. panthon panthon Public

    A Cybersecurity Attack Simulation Library for testing and strengthening system defenses.

    Python 8 1

  5. mlx mlx Public

    Forked from ml-explore/mlx

    MLX: An array framework for Apple silicon

    C++ 6 6

  6. ivy ivy Public

    Forked from djl11/ivy

    The Unified AI Framework

    Python