Skip to content

Commit

Permalink
Cleanup comments + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielsimard committed Jul 19, 2024
1 parent a7bdf67 commit 5be2f68
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 71 deletions.
2 changes: 1 addition & 1 deletion LICENSE-APACHE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Nathaniel Simard & Burn Framework Contributors
Copyright 2022 Nathaniel Simard & CubeCl Framework Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Nathaniel Simard & Burn Framework Contributors
Copyright (c) 2022 Nathaniel Simard & CubeCL Framework Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 2 additions & 6 deletions crates/cubecl-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
authors = ["Dilshod Tadjibaev (@antimora)", "Nathaniel Simard (@nathanielsimard)"]
categories = []
categories = ["science", "mathematics", "algorithms"]
description = "Common crate for CubeCL"
edition.workspace = true
keywords = []
keywords = ["gpu", "cuda", "wgpu"]
license.workspace = true
name = "cubecl-common"
readme.workspace = true
Expand All @@ -13,7 +13,6 @@ version.workspace = true
[features]
default = ["std"]
std = ["rand/std"]
doc = ["default"]

[target.'cfg(target_family = "wasm")'.dependencies]
getrandom = { workspace = true, features = ["js"] }
Expand All @@ -29,6 +28,3 @@ pollster = { workspace = true }

[dev-dependencies]
dashmap = { workspace = true }

[package.metadata.docs.rs]
features = ["doc"]
4 changes: 2 additions & 2 deletions crates/cubecl-common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Burn Common
# CubeCL Common

The `burn-common` package hosts code that _must_ be shared between burn packages (with `std` or
The `cubecl-common` package hosts code that _must_ be shared between cubecl packages (with `std` or
`no_std` enabled). No other code should be placed in this package unless unavoidable.

The package must build with `cargo build --no-default-features` as well.
4 changes: 2 additions & 2 deletions crates/cubecl-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]

//! # Burn Common Library
//! # CubeCL Common Library
//!
//! This library contains common types used by other Burn crates that must be shared.
//! This library contains common types used by other crates that must be shared.
#[macro_use]
extern crate derive_new;
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ authors = [
"nathanielsimard <[email protected]>",
"louisfd <[email protected]>",
]
categories = ["science"]
description = "Cube Compute Language (CubeCL) is a subset of Rust that can be executed on accelerators for compute intensive tasks."
categories = ["science", "mathematics", "algorithms"]
description = "CubeCL core create"
edition.workspace = true
keywords = []
license.workspace = true
Expand Down
5 changes: 1 addition & 4 deletions crates/cubecl-cuda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["nathanielsimard <[email protected]>"]
categories = ["science"]
description = "CUDA runtime for CubeCL"
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "gpu", "cuda"]
keywords = ["gpu", "cuda"]
license.workspace = true
name = "cubecl-cuda"
readme.workspace = true
Expand Down Expand Up @@ -40,6 +40,3 @@ cubecl-core = { path = "../cubecl-core", version = "0.1.0", features = [
cubecl-linalg = { path = "../cubecl-linalg", version = "0.1.0", features = [
"export_tests",
] }

[package.metadata.docs.rs]
features = ["doc"]
6 changes: 2 additions & 4 deletions crates/cubecl-cuda/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Burn-Cuda
# Cuda runtime

This backend is still a work in progress and not ready to be used.

See #1525
The runtime uses the lower level primitives from [cudarc](https://github.com/coreylowman/cudarc) to compile generated CUDA code into a ptx and execute it at runtime.
2 changes: 1 addition & 1 deletion crates/cubecl-linalg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = [
"nathanielsimard <[email protected]>",
"louisfd <[email protected]>",
]
categories = ["science"]
categories = ["science", "mathematics", "algorithms"]
description = "CubeCL Linear Algebra Components"
edition.workspace = true
keywords = []
Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = [
"louisfd <[email protected]",
]
categories = ["science"]
description = "TODO"
description = "Procedural macros for CubeCL"
edition.workspace = true
keywords = []
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["louisfd <[email protected]>", "Nathaniel Simard"]
categories = ["science"]
description = "Compute crate that helps creating high performance async backends."
description = "Crate that helps creating high performance async runtimes for CubeCL."
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "data"]
license.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Burn Compute
# CubeCL Runtime

This crate helps creating high performance async backends.
This crate helps creating high performance async runtimes.

- [x] Asynchronous kernel executions
- [x] Memory allocation management
Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-runtime/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]

//! Burn compute crate that helps creating high performance async backends.
//! CubeCL runtime crate that helps creating high performance async runtimes.
extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-runtime/tests/dummy/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use derive_new::new;

use super::DummyKernel;

/// The dummy server is used to test the burn-compute infrastructure.
/// The dummy server is used to test the cubecl-runtime infrastructure.
/// It uses simple memory management with a bytes storage on CPU, without asynchronous tasks.
#[derive(new, Debug)]
pub struct DummyServer<MM = SimpleMemoryManagement<BytesStorage>> {
Expand Down
6 changes: 3 additions & 3 deletions crates/cubecl-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
authors = ["nathanielsimard <[email protected]>"]
categories = ["science"]
description = "WGPU backend for the Burn framework"
description = "WGPU runtime for the CubeCL"
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "gpu", "wgpu", "webgpu"]
keywords = ["gpu", "wgpu", "webgpu", "gpgpu"]
license.workspace = true
name = "cubecl-wgpu"
readme.workspace = true
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-wgpu"
repository = "https://github.com/tracel-ai/cubecl/tree/main/crates/cubecl-wgpu"
version.workspace = true

[features]
Expand Down
30 changes: 3 additions & 27 deletions crates/cubecl-wgpu/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
# Burn WGPU Backend
# CubeCL WGPU Runtime

[Burn](https://github.com/tracel-ai/burn) WGPU backend

[![Current Crates.io Version](https://img.shields.io/crates/v/burn-wgpu.svg)](https://crates.io/crates/burn-wgpu)
[![license](https://shields.io/badge/license-MIT%2FApache--2.0-blue)](https://github.com/tracel-ai/burn-wgpu/blob/master/README.md)

This crate provides a WGPU backend for [Burn](https://github.com/tracel-ai/burn) using the
[wgpu](https://github.com/gfx-rs/wgpu).

The backend supports Vulkan, Metal, DirectX11/12, OpenGL, WebGPU.

## Usage Example

```rust
#[cfg(feature = "wgpu")]
mod wgpu {
use burn_autodiff::Autodiff;
use burn_wgpu::{Wgpu, WgpuDevice};
use mnist::training;

pub fn run() {
let device = WgpuDevice::default();
training::run::<Autodiff<Wgpu<f32, i32>>>(device);
}
}
```
[CubeCL](https://github.com/tracel-ai/cubecl) WGPU runtime.

## Configuration

You can set `BURN_WGPU_MAX_TASKS` to a positive integer that determines how many computing tasks are submitted in batches to the graphics API.
You can set `CUBECL_WGPU_MAX_TASKS` to a positive integer that determines how many computing tasks are submitted in batches to the graphics API.

## Platform Support

Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-wgpu/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub enum WgpuDevice {
/// `IntegratedGpu` since it's often a discrete GPU.
BestAvailable,

/// Use an externally created, existing, wgpu setup. This is helpful when using Burn in conjunction
/// with some existing wgpu setup (eg. egui or bevy), as resources can be transferred in & out of Burn.
/// Use an externally created, existing, wgpu setup. This is helpful when using CubeCL in conjunction
/// with some existing wgpu setup (eg. egui or bevy), as resources can be transferred in & out of CubeCL.
///
/// The device is indexed by the global wgpu [adapter ID](wgpu::Device::global_id).
Existing(wgpu::Id<wgpu::Device>),
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-wgpu/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ impl Default for RuntimeOptions {
#[cfg(not(test))]
const DEFAULT_MAX_TASKS: usize = 16;

let tasks_max = match std::env::var("BURN_WGPU_MAX_TASKS") {
let tasks_max = match std::env::var("CUBECL_WGPU_MAX_TASKS") {
Ok(value) => value
.parse::<usize>()
.expect("BURN_WGPU_MAX_TASKS should be a positive integer."),
.expect("CUBECL_WGPU_MAX_TASKS should be a positive integer."),
Err(_) => DEFAULT_MAX_TASKS,
};

Expand Down
11 changes: 5 additions & 6 deletions crates/cubecl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[package]
authors = ["nathanielsimard <[email protected]>"]
categories = []
description = ""
categories = ["science", "mathematics", "algorithms"]
description = "Multi-platform high-performance compute language extension for Rust."
edition.workspace = true
keywords = [
"gpu",
"cuda",
"wgpu",
"gpgpu",
"deep-learning",
"machine-learning",
"tensor",
]
license.workspace = true
name = "cubecl"
readme.workspace = true
repository = "https://github.com/tracel-ai/cubecl"
version.workspace = true
rust-version = "1.75"
rust-version = "1.79"

[features]
default = ["cubecl-wgpu?/default", "cubecl-cuda?/default", "linalg"]
default = ["linalg", "cubecl-wgpu?/default", "cubecl-cuda?/default"]
std = ["cubecl-wgpu?/std", "cubecl-cuda?/std"]
template = ["cubecl-core/template"]
linalg = ["dep:cubecl-linalg"]
Expand Down
4 changes: 2 additions & 2 deletions xtask/src/utils/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub(crate) fn get_workspace_members(w_type: WorkspaceMemberType) -> Vec<Workspac

/// Legacy cargo metadata format for member specs (rust < 1.77)
/// Example:
/// "backend-comparison 0.13.0 (path+file:///Users/username/burn/backend-comparison)"
/// "backend-comparison 0.13.0 (path+file:///Users/username/cubecl/backend-comparison)"
fn parse_workspace_member0(specs: &str) -> Option<(String, String)> {
let parts: Vec<_> = specs.split_whitespace().collect();
let (name, path) = (parts.first()?.to_owned(), parts.last()?.to_owned());
Expand All @@ -86,7 +86,7 @@ fn parse_workspace_member0(specs: &str) -> Option<(String, String)> {

/// Cargo metadata format for member specs (rust >= 1.77)
/// Example:
/// "path+file:///Users/username/burn/backend-comparison#0.13.0"
/// "path+file:///Users/username/cubecl/backend-comparison#0.13.0"
fn parse_workspace_member1(specs: &str) -> Option<(String, String)> {
let no_prefix = specs.replace(MEMBER_PATH_PREFIX, "").replace(')', "");
let path = Path::new(no_prefix.split_once('#')?.0);
Expand Down

0 comments on commit 5be2f68

Please sign in to comment.