From 0430272d06aa02ad43bd1bed57ab67dba8e2c541 Mon Sep 17 00:00:00 2001 From: cryscan Date: Sat, 9 Nov 2024 22:56:13 +0800 Subject: [PATCH] Upgrade dependencies. --- Cargo.toml | 20 ++++++++++---------- src/context.rs | 2 +- src/tensor/mod.rs | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c17a4de..244ce1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ version = "0.8.19" [dependencies] ahash = "0.8" anyhow = "1.0" -bytemuck = { version = "1.13", features = ["extern_crate_alloc"] } +bytemuck = { version = "1.19", features = ["extern_crate_alloc"] } derive-getters = "0.5" document-features = "0.2.8" flume = "0.11.0" @@ -24,20 +24,20 @@ half = { version = "2.2", features = ["bytemuck", "serde"] } instant = { version = "0.1", features = ["inaccurate", "wasm-bindgen"] } itertools = "0.13" log = "0.4" -regex = "1.10" +regex = "1.11" rustc-hash = "2.0.0" safetensors = "0.4" -serde = { version = "1.0", features = ["derive", "rc"] } +serde = { version = "1.0.210", features = ["derive", "rc"] } serde_bytes = "0.11.14" serde_json = "1.0" -thiserror = "1.0" +thiserror = "2.0" tracing = { version = "0.1.40", optional = true } tracing-subscriber = { version = "0.3.18", optional = true } tracing-tracy = { version = "0.11.0", optional = true } trait-variant = "0.1" uid = "0.1" wasm-bindgen = "0.2" -wgpu = "22.1.0" +wgpu = "23.0.0" [dependencies.web-rwkv-derive] path = "crates/web-rwkv-derive" @@ -46,19 +46,19 @@ version = "0.2.5" [dependencies.tokio] default-features = false features = ["macros", "rt", "sync", "time"] -version = "1.40" +version = "1.41" [dev-dependencies] cbor4ii = { version = "0.3.2", features = ["half-f16", "serde1"] } -fastrand = "2.0" +fastrand = "2.2" memmap2 = "0.9" tokio = { version = "1.37", features = ["full"] } # wgpu-profiler = "0.14.1" -clap = { version = "4.3", features = ["derive"] } +clap = { version = "4.5", features = ["derive"] } crossterm = "0.28" dialoguer = "0.11.0" -pollster = "0.3.0" -ratatui = { version = "0.28", features = ["all-widgets"] } +pollster = "0.4.0" +ratatui = { version = "0.29", features = ["all-widgets"] } simple_logger = { version = "5.0.0", features = ["stderr"] } [features] diff --git a/src/context.rs b/src/context.rs index 4d4cdb1..3b0a564 100644 --- a/src/context.rs +++ b/src/context.rs @@ -285,7 +285,7 @@ impl ContextInternal { label: Some(name), layout: layout.as_ref(), module, - entry_point, + entry_point: Some(entry_point), compilation_options: Default::default(), cache: None, }); diff --git a/src/tensor/mod.rs b/src/tensor/mod.rs index 0cf9ca9..0ed302c 100644 --- a/src/tensor/mod.rs +++ b/src/tensor/mod.rs @@ -477,6 +477,14 @@ impl TensorGpu { pub fn back_in_place(&self) -> TensorCpu { use crate::context::ContextEvent; + if self.is_empty() { + return TensorCpu { + shape: self.shape, + data: Arc::new([]), + phantom: PhantomData, + }; + } + let context = &self.context; let size = self.buffer.size(); let buffer = context.checkout_buffer( @@ -510,6 +518,14 @@ impl TensorGpu { pub async fn back(&self) -> TensorCpu { use crate::context::ContextEvent; + if self.is_empty() { + return TensorCpu { + shape: self.shape, + data: Arc::new([]), + phantom: PhantomData, + }; + } + let context = &self.context; let size = self.buffer.size(); let buffer = context.checkout_buffer( @@ -541,6 +557,14 @@ impl TensorGpu { #[cfg(target_arch = "wasm32")] pub async fn back(self) -> TensorCpu { + if self.is_empty() { + return TensorCpu { + shape: self.shape, + data: Arc::new([]), + phantom: PhantomData, + }; + } + let context = &self.context; let size = self.buffer.size(); let buffer = context.checkout_buffer(