feat(转换工具): 1. 更新依赖库 burn,启用 wgpu、fusion 和 autotune 特性 2. 修改主程序以使用 Wgpu 设备进行模型转换 3. 更新输出信息以反映 GPU 加速

This commit is contained in:
2026-07-08 15:22:00 +08:00
parent e235edee4a
commit 564b1e4a09
3 changed files with 6 additions and 10 deletions
Generated
-4
View File
@@ -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",
+1 -1
View File
@@ -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"
+5 -5
View File
@@ -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::<Flex>(safetensors_path, config_path, tokenizer_path, &tasks, &device)?;
run_export::<Wgpu>(safetensors_path, config_path, tokenizer_path, &tasks, &device)?;
Ok(())
}
}