mirror of
https://github.com/storytold/lightcraft.git
synced 2026-12-04 04:53:04 -05:00
Part 2 of 5 of #2167. lightcraft-gpu gets a `sam` feature with `sam3`: a device of its own (like denoise and faces, with the same switches, the crash sentinel and the shutdown gate), the shared kernels (tiled matrix products with bias / GELU / residual in the epilogue, flash-style attention, layer norm, RoPE, im2col, the final reorder) and the image encoder built from them. The engine now uses it as the GPU backbone where candle has no GPU (not macOS); the necks and the text detector's heads stay in candle. An adapter without the needed limits (98 MB storage buffers, 16 KB workgroup memory) or whose device can't be created gets no device; the backbone then runs in candle on the CPU and Settings shows why (sam3::tests::an_adapter_short_of_the_limits_is_refused_with_what_it_lacks). A pass that doesn't finish names its stage in the reason the device is given up with. The parity test prints the largest mask difference to the CPU next to the IoU. Co-Authored-By: Claude Opus 5.5 <[email protected]>
49 lines
1.7 KiB
TOML
49 lines
1.7 KiB
TOML
[package]
|
|
name = "lightcraft-gpu"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "LightCraft GPU develop pipeline: wgpu compute (WGSL) twin of the CPU pipeline, which stays the reference (L3)"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
lightcraft-denoise = { workspace = true, optional = true }
|
|
lightcraft-geom = { workspace = true }
|
|
lightcraft-color = { workspace = true }
|
|
lightcraft-raster = { workspace = true }
|
|
lightcraft-develop = { workspace = true }
|
|
lightcraft-faces = { workspace = true }
|
|
lightcraft-pipeline = { workspace = true }
|
|
log = { workspace = true }
|
|
|
|
# Native only: Metal / Vulkan / DX12 through wgpu (pure Rust; the drivers are the system's).
|
|
# The browser build keeps the CPU pipeline (WebGPU needs async device creation: see docs/gpu-pipeline.md).
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
wgpu = { workspace = true }
|
|
pollster = { workspace = true }
|
|
bytemuck = { workspace = true }
|
|
# the SAM 3 backbone kernels (`sam` feature) implement `lightcraft_segment::BackboneAccel`
|
|
lightcraft-segment = { workspace = true, optional = true }
|
|
|
|
[features]
|
|
default = []
|
|
denoise = ["dep:lightcraft-denoise", "lightcraft-denoise/runtime"]
|
|
# SAM 3's vision backbone on the GPU (`sam3`); the engine's `sam` feature turns it on
|
|
sam = ["dep:lightcraft-segment"]
|
|
|
|
[dev-dependencies]
|
|
# tests record why they skip (`cargo xtask ci` lists the skips)
|
|
lightcraft-testkit = { workspace = true }
|
|
lightcraft-scenes = { workspace = true }
|
|
lightcraft-raw = { workspace = true }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
|
# the SAM 3 backbone test and benchmark compare against the candle backbone
|
|
candle-core = { workspace = true }
|
|
|
|
[[example]]
|
|
name = "sam3_backbone_bench"
|
|
required-features = ["sam"]
|