GithubHelp home page GithubHelp logo

typio / nervous Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 0.0 32.78 MB

Deep Learning Framework in WebGPU (For Education)

Home Page: https://nervous.vercel.app

JavaScript 0.69% TypeScript 71.72% HTML 0.67% Svelte 26.90% CSS 0.03%
deep-learning machine-learning typescript wgsl ml javascript webgpu

nervous's Introduction

nervous

Web Machine Learning Framework

Docs โ€ข Demos

Overview

An ML framework for the browser, with these goals:

  • simple yet efficient
  • less convoluted than TensorFlow and pyTorch
  • supporting levels of interaction from tensor operations to full neural nets.

Features GPU acceleration using WebGPU and compute shaders.

I decided to remove the dual-backend system supporting JavaScript and WebGPU and go forward with just WebGPU. It's a hard choice because I've invested so much in the JS backend, but it will be useless outside of educational purposes once WebGPU is released and removing the multiple backend support will reduce the architectural complexity of the library and the lag time of new features.

Usage

package is not yet published

import nv from "@typio/nervous";

const main = async () => {
    await nv.init();
    const [n, m] = await Promise.all([
        nv.random([2047, 512]),
        nv.random([512, 2047]),
    ]);
    let res = n.dot(m);

    await res.print(4);
};

main();

nervous's People

Contributors

typio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nervous's Issues

Solve WebGPU OP exceeding max compute workgroups

Potential Solutions

1. Settle with current limits
(only guarantee <=2047x2047, result of workgroup_size(64))

1. Utilize x,y maybe z at 64
(cons: verbose wgsl with conversions from 2d/3d to 1d indicies)

2. Loops in wgsl to extend
(cons: technically lessens parallelization, how much would be enough??)

3. Chunk tensor op?
(cons: buffer memory will overflow anyway and this would add a much more complexity)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.