# 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 = "2021"
name = "gllm-kernels"
version = "0.1.3"
authors = ["gllm contributors"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Low-level attention kernels for gllm with CUDA/ROCm support"
homepage = "https://github.com/putao520/gllm-kernels"
readme = "README.md"
keywords = [
    "attention",
    "kernels",
    "burn",
    "gpu",
    "tensor",
]
categories = [
    "algorithms",
    "science",
]
license = "Apache-2.0"
repository = "https://github.com/putao520/gllm-kernels"

[features]
cpu = ["burn-ndarray"]
cuda = ["burn-cuda"]
cuda-kernel = [
    "cudarc",
    "half",
]
default = ["cpu"]
flash-attention-v3 = [
    "flash-attention-v3-wgmma",
    "flash-attention-v3-async",
    "flash-attention-v3-fp8",
    "flash-attention-v3-block-quant",
]
flash-attention-v3-async = []
flash-attention-v3-block-quant = []
flash-attention-v3-fp8 = []
flash-attention-v3-wgmma = []
fusion = [
    "burn/fusion",
    "burn-fusion",
]
nccl = [
    "cudarc/nccl",
    "cuda",
]
rocm-kernel = ["half"]
wgpu = ["burn-wgpu"]

[lib]
name = "gllm_kernels"
path = "src/lib.rs"

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

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

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

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

[[bench]]
name = "attention_bench"
path = "benches/attention_bench.rs"
harness = false

[dependencies.burn]
version = "0.20.0-pre.6"
default-features = false

[dependencies.burn-cuda]
version = "0.20.0-pre.6"
optional = true

[dependencies.burn-fusion]
version = "0.20.0-pre.6"
optional = true

[dependencies.burn-ndarray]
version = "0.20.0-pre.6"
optional = true

[dependencies.burn-wgpu]
version = "0.20.0-pre.6"
optional = true

[dependencies.crossbeam-channel]
version = "0.5"

[dependencies.cudarc]
version = "0.18"
features = [
    "std",
    "driver",
    "nvrtc",
    "f16",
    "cuda-12090",
    "dynamic-loading",
]
optional = true
default-features = false

[dependencies.half]
version = "2.7"
optional = true

[dependencies.log]
version = "0.4"

[dev-dependencies.criterion]
version = "0.5"
