diff --git a/Cargo.lock b/Cargo.lock index 22f88f7..4ed20b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -564,7 +564,6 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0098bf6555c151517b4c98ca0e8ed1ab6a976e40f5f4e967c117b00eee21e192" dependencies = [ - "aligned-vec", "burn-backend", "burn-ir", "burn-std", @@ -572,9 +571,7 @@ dependencies = [ "gemm", "half", "libm", - "macerator", "num-traits", - "rayon", ] [[package]] @@ -752,7 +749,6 @@ dependencies = [ "aligned-vec", "bon", "burn-cubecl", - "burn-flex", "burn-fusion", "burn-ir", "burn-tensor", diff --git a/examples/convert/Cargo.toml b/examples/convert/Cargo.toml index 34a5ba0..76991e3 100644 --- a/examples/convert/Cargo.toml +++ b/examples/convert/Cargo.toml @@ -9,5 +9,5 @@ path = "src/main.rs" [dependencies] minicpm-convert = { path = "../../crates/minicpm-convert" } -burn = { version = "0.21", default-features = false, features = ["std", "flex"] } +burn = { version = "0.21", default-features = false, features = ["std", "wgpu", "fusion", "autotune"] } anyhow = "1.0" diff --git a/examples/convert/src/main.rs b/examples/convert/src/main.rs index c729c59..cea9f66 100644 --- a/examples/convert/src/main.rs +++ b/examples/convert/src/main.rs @@ -1,4 +1,4 @@ -use burn::backend::{flex::FlexDevice, Flex}; +use burn::backend::{wgpu::WgpuDevice, Wgpu}; use minicpm_convert::{run_export, ExportTask, Format}; use std::path::Path; @@ -7,14 +7,14 @@ fn main() -> anyhow::Result<()> { let config_path = Path::new("MiniCPM5-1B/config.json"); let tokenizer_path = Path::new("MiniCPM5-1B/tokenizer.json"); - println!("模型转换工具"); + println!("模型转换工具 (Wgpu GPU 加速)"); println!("源文件: {:?}", safetensors_path); println!(); - let device = FlexDevice::default(); + let device = WgpuDevice::default(); let tasks = vec![ExportTask::new(Format::Full)]; - run_export::(safetensors_path, config_path, tokenizer_path, &tasks, &device)?; + run_export::(safetensors_path, config_path, tokenizer_path, &tasks, &device)?; Ok(()) -} +} \ No newline at end of file