burn/burn-wgpu
Nathaniel Simard 809ad72843
Fix flaky init (#842)
* Fix flaky init

* Remove print
2023-10-03 13:57:16 -04:00
..
benches wgpu: Yet another (faster) matmul (#836) 2023-10-02 14:05:53 -04:00
src Fix flaky init (#842) 2023-10-03 13:57:16 -04:00
Cargo.toml Feat/async read (#833) 2023-09-28 17:09:58 -04:00
LICENSE-APACHE Feat/wgpu backend setup (#376) 2023-06-02 11:52:47 -04:00
LICENSE-MIT Feat/wgpu backend setup (#376) 2023-06-02 11:52:47 -04:00
README.md Can configure wgpu max tasks (#603) 2023-08-23 12:20:27 -04:00

README.md

Burn WGPU Backend

Burn WGPU backend

Current Crates.io Version license

This crate provides a WGPU backend for Burn utilizing the wgpu.

The backend supports Vulkan, Metal, DirectX11/12, OpenGL, WebGPU.

Usage Example

#[cfg(feature = "wgpu")]
mod wgpu {
    use burn_autodiff::ADBackendDecorator;
    use burn_wgpu::{AutoGraphicsApi, WgpuBackend, WgpuDevice};
    use mnist::training;

    pub fn run() {
        let device = WgpuDevice::default();
        training::run::<ADBackendDecorator<WgpuBackend<AutoGraphicsApi, f32, i32>>>(device);
    }
}

Configuration

You can set BURN_WGPU_MAX_TASKS to a positive integer that determines how many computing tasks are submitted in batches to the graphics API. The best value should be the smallest one that allows 100% GPU usage. A high value might increase GPU memory usage with no benefit.