forge-ml 0.1.0

A WebGPU-native machine learning runtime in Rust: train and run GPT-2 on any GPU wgpu reaches, with no CUDA and no Python
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.87"
name = "forge-ml"
version = "0.1.0"
build = false
include = [
    "src/**/*.rs",
    "shaders/*.wgsl",
    "examples/*.rs",
    "tests/**/*",
    "README.md",
    "LICENSE",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A WebGPU-native machine learning runtime in Rust: train and run GPT-2 on any GPU wgpu reaches, with no CUDA and no Python"
homepage = "https://aisuko.github.io/forge/"
documentation = "https://docs.rs/forge-ml"
readme = "README.md"
keywords = [
    "machine-learning",
    "webgpu",
    "wgpu",
    "gpt2",
    "transformer",
]
categories = [
    "science",
    "wasm",
    "graphics",
]
license = "AGPL-3.0-only"
repository = "https://github.com/Aisuko/forge"

[features]
tui = [
    "dep:ratatui",
    "dep:crossterm",
    "dep:sysinfo",
    "dep:nvml-wrapper",
    "dep:memmap2",
]

[lib]
name = "forge"
crate-type = [
    "rlib",
    "cdylib",
]
path = "src/lib.rs"

[[bin]]
name = "forge-top"
path = "src/bin/forge-top/main.rs"
required-features = ["tui"]

[[example]]
name = "gate_tokens"
path = "examples/gate_tokens.rs"

[[example]]
name = "generate"
path = "examples/generate.rs"

[[example]]
name = "train_shakespeare"
path = "examples/train_shakespeare.rs"

[[example]]
name = "wgpu_probe"
path = "examples/wgpu_probe.rs"

[[test]]
name = "autograd"
path = "tests/autograd.rs"

[[test]]
name = "char_model"
path = "tests/char_model.rs"

[[test]]
name = "gpt2_e2e"
path = "tests/gpt2_e2e.rs"

[[test]]
name = "kv_cache"
path = "tests/kv_cache.rs"

[[test]]
name = "op_parity"
path = "tests/op_parity.rs"

[[test]]
name = "streaming"
path = "tests/streaming.rs"

[[test]]
name = "tokenizer"
path = "tests/tokenizer.rs"

[[test]]
name = "train_ops"
path = "tests/train_ops.rs"

[[test]]
name = "training"
path = "tests/training.rs"

[dependencies.bytemuck]
version = "1"

[dependencies.fancy-regex]
version = "0.14"

[dependencies.rand]
version = "0.9"

[dependencies.safetensors]
version = "0.5"

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1"

[dependencies.wgpu]
version = "26"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.crossterm]
version = "0.29"
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.memmap2]
version = "0.9"
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.nvml-wrapper]
version = "0.12"
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.pollster]
version = "0.4"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.ratatui]
version = "0.30"
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.rayon]
version = "1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.sysinfo]
version = "0.39"
optional = true

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.pollster]
version = "0.4"

[target.'cfg(target_arch = "wasm32")'.dependencies.console_error_panic_hook]
version = "0.1"

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.3"
features = ["wasm_js"]

[target.'cfg(target_arch = "wasm32")'.dependencies.js-sys]
version = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies.wasm-bindgen]
version = "0.2"

[target.'cfg(target_arch = "wasm32")'.dependencies.wasm-bindgen-futures]
version = "0.4"

[profile.dev]
opt-level = 2

[profile.dev.package."*"]
opt-level = 3

[profile.release]
lto = "thin"