huggingface/ratchet

Minimum number of copies from `Uint8Array` to `wgpu::Buffer`

Ouverte

#171 ouverte le 18 avr. 2024

 (4 commentaires) (1 réaction) (0 personne assignée)Rust (44 forks)auto 404
help wanted

Métriques du dépôt

Stars
 (768 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Currently in wgpu, there is no way to create a wgpu::Buffer directly from Uint8Array.

This means that our tensor data does something like this:

IndexedDB -> Uint8Array -> Vec<u8> ~~> Uint8Array -> WebGPU

Judging by this: https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer

I think the optimal is:

IndexedDB -> Uint8Array -> WebGPU

Reference: https://github.com/gfx-rs/wgpu/blob/trunk/wgpu/src/backend/webgpu.rs#L1821

Guide contributeur