Skip to content

Commit

Permalink
Upgrade dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryscan committed Nov 9, 2024
1 parent 34d945a commit 0430272
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
24 changes: 24 additions & 0 deletions src/tensor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,14 @@ impl<T: Scalar, K: Kind> TensorGpu<T, K> {
pub fn back_in_place(&self) -> TensorCpu<T> {
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(
Expand Down Expand Up @@ -510,6 +518,14 @@ impl<T: Scalar, K: Kind> TensorGpu<T, K> {
pub async fn back(&self) -> TensorCpu<T> {
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(
Expand Down Expand Up @@ -541,6 +557,14 @@ impl<T: Scalar, K: Kind> TensorGpu<T, K> {

#[cfg(target_arch = "wasm32")]
pub async fn back(self) -> TensorCpu<T> {
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(
Expand Down

0 comments on commit 0430272

Please sign in to comment.