mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
MlDevice wraps hanzo_ml::Device (CPU/CUDA/Metal/…); MlTensor wraps hanzo_ml::Tensor — already an Arc-backed device-resident handle, so it IS the DeviceTensor abstraction concretely (zero-copy step-to-step). The same steps run on CPU or GPU; only the Device ctor differs (MlDevice::cpu vs ::cuda). flow-core stays std-only — hanzo-ml lives behind this crate so hanzo-desktop embeds flow-core alone (tiny) or flow-ml (with compute) as needed. Verified on CPU (no GPU): a real affine op runs through GpuResidentBackend, 1.0→2.0, result resident on the injected device. 2/2, clippy clean. cuda/metal features forward to hanzo-ml for on-GPU residence.
22 lines
763 B
TOML
22 lines
763 B
TOML
[package]
|
|
name = "flow-ml"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.88"
|
|
description = "The hanzo-ml binding for flow-core: MlDevice/MlTensor make the GpuResident seam concrete. Same steps run on CPU or GPU — only the Device ctor differs. CPU by default; enable `cuda`/`metal` for on-GPU residence."
|
|
license = "MIT"
|
|
|
|
[lib]
|
|
name = "flow_ml"
|
|
|
|
# flow-core stays std-only; the heavy compute dep lives here, behind this crate, so
|
|
# hanzo-desktop can embed flow-core alone (tiny) or flow-ml (with hanzo-ml) as needed.
|
|
[dependencies]
|
|
flow-core = { path = "../core-rs" }
|
|
hanzo-ml = { path = "../../ml/hanzo-ml" }
|
|
|
|
[features]
|
|
# CPU by default (default = []). A GPU-resident build just forwards to hanzo-ml.
|
|
cuda = ["hanzo-ml/cuda"]
|
|
metal = ["hanzo-ml/metal"]
|