Was reading through the native backend and I don't think the WebGPU target actually runs on the GPU. Wanted to check if this is WIP before assuming.
What I'm seeing:
device.rs compiles every .wgsl into a ComputePipeline and exposes get_pipeline(), create_buffer_init(), create_buffer_zeros().
- None of those have callers. The only command encoder in the file (
read_buffer) is a buffer-to-staging copy for readback, not a compute pass, and there's no dispatch_workgroups anywhere in src/native/. So no shader ever executes.
- Every
GpuDevice::instance() call in ops/ sits inside a #[cfg(feature="cuda")] block, so under --features webgpu they don't compile. The ops fall through to the #[cfg(any(feature="cpu", feature="webgpu"))] bodies, which are pure host code (add is a closure over Vec<f32>, matmul is the CPU triple-loop). A webgpu build computes on the CPU while uploading shaders it never runs.
Separate thing: the README says all three backends share the same autograd tape. The browser WebGPU path looks like its own TS engine in src/web/ with its own tape (src/web/tape.ts), separate from the Rust tape in autograd.rs that CPU and CUDA use. So that line might be worth rescoping to CPU+CUDA.
Is native WebGPU WIP? If so it'd help to note it in the README so the webgpu flag isn't read as GPU execution.
Was reading through the native backend and I don't think the WebGPU target actually runs on the GPU. Wanted to check if this is WIP before assuming.
What I'm seeing:
device.rscompiles every.wgslinto aComputePipelineand exposesget_pipeline(),create_buffer_init(),create_buffer_zeros().read_buffer) is a buffer-to-staging copy for readback, not a compute pass, and there's nodispatch_workgroupsanywhere insrc/native/. So no shader ever executes.GpuDevice::instance()call inops/sits inside a#[cfg(feature="cuda")]block, so under--features webgputhey don't compile. The ops fall through to the#[cfg(any(feature="cpu", feature="webgpu"))]bodies, which are pure host code (addis a closure overVec<f32>,matmulis the CPU triple-loop). A webgpu build computes on the CPU while uploading shaders it never runs.Separate thing: the README says all three backends share the same autograd tape. The browser WebGPU path looks like its own TS engine in
src/web/with its own tape (src/web/tape.ts), separate from the Rust tape inautograd.rsthat CPU and CUDA use. So that line might be worth rescoping to CPU+CUDA.Is native WebGPU WIP? If so it'd help to note it in the README so the
webgpuflag isn't read as GPU execution.