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:
2026-03-05 19:39:14 +01:00
parent 4bb7ca9074
commit 3a67c0979c
1605 changed files with 537032 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
[package]
authors = ["nathanielsimard <nathaniel.simard.42@gmail.com>"]
categories = ["science"]
description = "CUDA backend for the Burn framework"
documentation = "https://docs.rs/burn-cuda"
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "gpu", "cuda"]
license.workspace = true
name = "burn-cuda"
readme.workspace = true
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-cuda"
version.workspace = true
[lints]
workspace = true
[features]
autotune = ["burn-cubecl/autotune"]
autotune-checks = ["burn-cubecl/autotune-checks"]
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",
]
[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", default-features = false, features = [
"cubecl-cuda",
] }
cubecl = { workspace = true, features = ["cuda"] }
[package.metadata.docs.rs]
features = ["doc"]
rustdoc-args = ["--cfg", "docsrs"]

View File

@@ -0,0 +1,30 @@
# Burn CUDA Backend
[Burn](https://github.com/tracel-ai/burn) CUDA backend
[![Current Crates.io Version](https://img.shields.io/crates/v/burn-cuda.svg)](https://crates.io/crates/burn-cuda)
[![license](https://shields.io/badge/license-MIT%2FApache--2.0-blue)](https://github.com/tracel-ai/burn-cuda/blob/master/README.md)
This crate provides a CUDA backend for [Burn](https://github.com/tracel-ai/burn) using the
[cubecl](https://github.com/tracel-ai/cubecl.git) and [cudarc](https://github.com/coreylowman/cudarc.git)
crates.
## Usage Example
```rust
#[cfg(feature = "cuda")]
mod cuda {
use burn_autodiff::Autodiff;
use burn_cuda::{Cuda, CudaDevice};
use mnist::training;
pub fn run() {
let device = CudaDevice::default();
training::run::<Autodiff<Cuda<f32, i32>>>(device);
}
}
```
## Dependencies
Requires CUDA 12.x to be installed and on the `PATH`.

View File

@@ -0,0 +1,47 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
extern crate alloc;
use burn_cubecl::CubeBackend;
pub use cubecl::cuda::CudaDevice;
use cubecl::cuda::CudaRuntime;
#[cfg(not(feature = "fusion"))]
pub type Cuda<F = f32, I = i32> = CubeBackend<CudaRuntime, F, I, u8>;
#[cfg(feature = "fusion")]
pub type Cuda<F = f32, I = i32> = burn_fusion::Fusion<CubeBackend<CudaRuntime, F, I, u8>>;
#[cfg(all(test, not(target_os = "macos")))]
mod tests {
use super::*;
use burn_backend::{Backend, DType, QTensorPrimitive};
use burn_cubecl::tensor::CubeTensor;
#[test]
fn should_support_dtypes() {
type B = Cuda;
let device = Default::default();
assert!(B::supports_dtype(&device, DType::F32));
assert!(B::supports_dtype(&device, DType::Flex32));
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::Bool));
assert!(B::supports_dtype(
&device,
DType::QFloat(CubeTensor::<CudaRuntime>::default_scheme())
));
// Currently not registered in supported types
assert!(!B::supports_dtype(&device, DType::F64));
}
}