npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

accel-gpu

v1.0.3

Published

NumPy for the browser GPU — zero shaders, zero dependencies

Readme

accel-gpu

NumPy for the browser GPU — zero shaders, zero dependencies.

A lightweight WebGPU wrapper for data processing and math. No WGSL required. Automatic fallback to WebGL2 or CPU. Perfect for local-first AI, data dashboards, and heavy array computations.

Why accel-gpu?

  • Shader-free API — No WGSL or GLSL. Write NumPy-like JavaScript; kernels are built-in.
  • Zero dependencies — ~160KB minified, lightweight and self-contained.
  • Universal fallback — WebGPU → WebGL2 → CPU. Runs in Safari, Firefox, Node, and headless.
  • Shape inference — Matmul and ML ops automatically infer dimensions.
  • Performance — WebGPU delivers 2–3× speedups over WebGL for compute; ~20× faster than CPU on large matmul (Chrome, M3 MacBook).
  • Accelerated opsconv2d, maxPool2d, avgPool2d, fft, ifft, and fftMagnitude run on WebGPU when available.
  • Automatic scalar fusion — chained scalar add/sub/mul/div are fused before execution.
  • Arrow interop — import Apache Arrow-like vectors/columns via fromArrow(...) and gpu.fromArrow(...).

Compared to TensorFlow.js or GPU.js, accel-gpu offers a simpler API focused on core array operations without the overhead of a full ML framework.

npm Bundlephobia Tests License: MIT TypeScript

Install

npm install accel-gpu

TypeScript: Definitions are included; no @types package needed.

Quick Start

import { init, matmul, softmax } from "accel-gpu";

const gpu = await init();

// Create GPU-backed arrays (WebGPU, WebGL2, or CPU)
const a = gpu.array([1, 2, 3, 4]);
const b = gpu.array([5, 6, 7, 8]);

// Method chaining
await a.add(b);
const total = await a.sum();
console.log(total); // 26

// Shape inference — no need to pass M, N, K
const A = gpu.array(new Float32Array([1, 2, 3, 4, 5, 6]), [2, 3]);
const B = gpu.array(new Float32Array([1, 2, 3, 4, 5, 6]), [3, 2]);
const C = await matmul(gpu, A, B);

// Softmax with shape inference
const logits = gpu.array([1, 2, 3, 4]);
const probs = await softmax(gpu, logits);
console.log(await probs.toArray());

Demos

Run npm run build first, then npx serve . — visit /, /example/, /example/image/, etc.

Documentation

  • Docs site (VitePress): https://phantasm0009.github.io/accel-gpu/
  • Quick Start: https://phantasm0009.github.io/accel-gpu/guide/quickstart
  • API Reference: https://phantasm0009.github.io/accel-gpu/api

The full API reference, shape expectations, and runnable embedded playground/examples have moved to the docs site.

Tree-shakable imports

import { matmul, transpose } from "accel-gpu/linalg";
import { softmax } from "accel-gpu/ml";
import { fft } from "accel-gpu/signal";
import { fromArrow, fromBuffer } from "accel-gpu/data";

Fallback Chain

  1. WebGPU — Chrome 113+, Edge 113+ (best performance)
  2. WebGL2 — Safari, Firefox, older Chrome (GPU-accelerated)
  3. CPU — Node, headless, or when no GPU available

Troubleshooting

  • GET /.well-known/appspecific/com.chrome.devtools.json returning 404 in local server logs is a Chrome DevTools probe and is harmless.
  • 304 responses for files like dist/index.js and source maps are normal cache revalidation, not runtime failures.

Cross-Browser Validation

  • Playwright browser tests run across Chromium, Firefox, and WebKit in CI to validate fallback behavior.

Backend Tolerance & Debugging

  • Results are validated across backend selections using numeric tolerances (typically 1e-4 to 2e-4).
  • For debugging or deterministic comparisons, use init({ forceCPU: true }) and compare against init() output.
  • Full guidance: https://phantasm0009.github.io/accel-gpu/guide/backend-tolerance

Contributing

Contributions are welcome! See CONTRIBUTING.md for setup, architecture, and guidelines. Quick start: clone, npm install, npm test, then open a PR. We adhere to the Contributor Covenant code of conduct.

License

MIT