From 564b1e4a091ef37279a169e4495eee1001f20e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=8F=E5=BB=BA?= Date: Wed, 8 Jul 2026 15:22:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=BD=AC=E6=8D=A2=E5=B7=A5=E5=85=B7):=201?= =?UTF-8?q?.=20=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96=E5=BA=93=20burn?= =?UTF-8?q?=EF=BC=8C=E5=90=AF=E7=94=A8=20wgpu=E3=80=81fusion=20=E5=92=8C?= =?UTF-8?q?=20autotune=20=E7=89=B9=E6=80=A7=202.=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BB=E7=A8=8B=E5=BA=8F=E4=BB=A5=E4=BD=BF=E7=94=A8=20Wgpu?= =?UTF-8?q?=20=E8=AE=BE=E5=A4=87=E8=BF=9B=E8=A1=8C=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=203.=20=E6=9B=B4=E6=96=B0=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BB=A5=E5=8F=8D=E6=98=A0=20GPU=20=E5=8A=A0?= =?UTF-8?q?=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 4 ---- examples/convert/Cargo.toml | 2 +- examples/convert/src/main.rs | 10 +++++----- 3 files changed, 6 insertions(+), 10 deletions(-) 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