feat: update workspace paths and enhance gitignore
- Updated stablediffusion crate path from "../stable-diffusion-burn" to "./crates/stable-diffusion-burn" for proper workspace resolution - Enhanced .gitignore to include generated model files (.mpk, .pt, .bin, .safetensors, .ckpt) and user_data directory - Added Cargo.lock to gitignore with appropriate comment - Reorganized IDE files section in gitignore for better clarity - Added newline at end of file for proper formatting
This commit is contained in:
42
crates/stable-diffusion-burn/burn-crates/burn-cpu/Cargo.toml
Normal file
42
crates/stable-diffusion-burn/burn-crates/burn-cpu/Cargo.toml
Normal file
@@ -0,0 +1,42 @@
|
||||
[package]
|
||||
authors = ["marcantoinem <marc-antoine.m@outlook.com>"]
|
||||
categories = ["science"]
|
||||
description = "MLIR based CPU backend for the Burn framework"
|
||||
documentation = "https://docs.rs/burn-cpu"
|
||||
edition.workspace = true
|
||||
keywords = ["deep-learning", "machine-learning", "cpu"]
|
||||
license.workspace = true
|
||||
name = "burn-cpu"
|
||||
readme.workspace = true
|
||||
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-cpu"
|
||||
version.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
default = ["std", "fusion", "autotune", "burn-cubecl/default", "cubecl/default"]
|
||||
doc = ["burn-cubecl/doc"]
|
||||
fusion = ["burn-fusion", "burn-cubecl/fusion"]
|
||||
std = ["burn-cubecl/std", "cubecl/std"]
|
||||
tracing = [
|
||||
"burn-backend/tracing",
|
||||
"burn-cubecl/tracing",
|
||||
"burn-fusion?/tracing",
|
||||
"cubecl/tracing",
|
||||
]
|
||||
|
||||
autotune = ["burn-cubecl/autotune"]
|
||||
autotune-checks = ["burn-cubecl/autotune-checks"]
|
||||
|
||||
[dependencies]
|
||||
burn-fusion = { path = "../burn-fusion", version = "=0.21.0-pre.2", optional = true }
|
||||
burn-cubecl = { path = "../burn-cubecl", version = "=0.21.0-pre.2", default-features = false }
|
||||
burn-backend = { path = "../burn-backend", version = "=0.21.0-pre.2", features = [
|
||||
"cubecl-cpu",
|
||||
] }
|
||||
cubecl = { workspace = true, features = ["cpu"] }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["doc"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
12
crates/stable-diffusion-burn/burn-crates/burn-cpu/README.md
Normal file
12
crates/stable-diffusion-burn/burn-crates/burn-cpu/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Burn CPU Backend
|
||||
|
||||
[Burn](https://github.com/tracel-ai/burn) CubeCL CPU backend
|
||||
|
||||
[](https://crates.io/crates/burn-cuda)
|
||||
|
||||
This crate provides a MLIR based CPU backend for [Burn](https://github.com/tracel-ai/burn) using the
|
||||
[cubecl](https://github.com/tracel-ai/cubecl.git) crates.
|
||||
|
||||
## Usage Example
|
||||
|
||||
Example coming soon
|
||||
47
crates/stable-diffusion-burn/burn-crates/burn-cpu/src/lib.rs
Normal file
47
crates/stable-diffusion-burn/burn-crates/burn-cpu/src/lib.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use burn_cubecl::CubeBackend;
|
||||
pub use cubecl::cpu::CpuDevice;
|
||||
use cubecl::cpu::CpuRuntime;
|
||||
|
||||
#[cfg(not(feature = "fusion"))]
|
||||
pub type Cpu<F = f32, I = i32> = CubeBackend<CpuRuntime, F, I, u8>;
|
||||
|
||||
#[cfg(feature = "fusion")]
|
||||
pub type Cpu<F = f32, I = i32> = burn_fusion::Fusion<CubeBackend<CpuRuntime, F, I, u8>>;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use burn_backend::{Backend, DType, QTensorPrimitive};
|
||||
use burn_cubecl::tensor::CubeTensor;
|
||||
|
||||
#[test]
|
||||
fn should_support_dtypes() {
|
||||
type B = Cpu;
|
||||
let device = Default::default();
|
||||
|
||||
assert!(B::supports_dtype(&device, DType::F64));
|
||||
assert!(B::supports_dtype(&device, DType::F32));
|
||||
assert!(B::supports_dtype(&device, DType::F16));
|
||||
assert!(B::supports_dtype(&device, DType::BF16));
|
||||
assert!(B::supports_dtype(&device, DType::I64));
|
||||
assert!(B::supports_dtype(&device, DType::I32));
|
||||
assert!(B::supports_dtype(&device, DType::I16));
|
||||
assert!(B::supports_dtype(&device, DType::I8));
|
||||
assert!(B::supports_dtype(&device, DType::U64));
|
||||
assert!(B::supports_dtype(&device, DType::U32));
|
||||
assert!(B::supports_dtype(&device, DType::U16));
|
||||
assert!(B::supports_dtype(&device, DType::U8));
|
||||
assert!(B::supports_dtype(
|
||||
&device,
|
||||
DType::QFloat(CubeTensor::<CpuRuntime>::default_scheme())
|
||||
));
|
||||
|
||||
// Currently not registered in supported types
|
||||
assert!(!B::supports_dtype(&device, DType::Flex32));
|
||||
assert!(!B::supports_dtype(&device, DType::Bool));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user