Coder Social home page Coder Social logo

petamoriken / proposal-float16array Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tc39/proposal-float16array

0.0 2.0 0.0 35 KB

a proposal to add float16 TypedArrays to JavaScript

Home Page: http://tc39.es/proposal-float16array/

HTML 100.00%

proposal-float16array's Introduction

Float16Array

A proposal to add float16 (aka half-precision or binary16) TypedArrays to JavaScript.

Status

Authors: Kevin Gibbons

Champions: Leo Balter

This proposal is at Stage 1 of The TC39 Process.

Spec text is available here.

Motivation

  • Explicit request from the Color on the Web CG, for their use case with float-backed canvases.
  • Useful for GPU operations, where full precision often isn't necessary and memory constraints are serious.
    • WebGPU supports float16. It exposes/consumes raw ArrayBuffers. When those contain 32-bit floats, the pattern is to wrap the buffer in new Float32Array(...); that doesn't work when they contain 16-bit floats.
    • Increasingly relevant with new tools like Stable Diffusion, where full-precision representations don't fit in VRAM on many machines.
  • Faking it in userland has serious performance costs.

Proposal

This would add a new kind of TypedArray, Float16Array, to complement the existing Float32Array and Float64Array. It would also add two new methods on DataView for reading and setting float16 values, as getFloat16 and setFloat16, to complement the existing similar methods for working with full and double precision floats.

proposal-float16array's People

Contributors

bakkot avatar

Watchers

 avatar  avatar

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.