Skip to content

Commit 69df84a

Browse files
committed
fix: clip 模型使用 non-mask softmax
Signed-off-by: YdrMaster <[email protected]>
1 parent 7883f84 commit 69df84a

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ itertools = "0.13"
3838
env_logger = "0.11"
3939
build-script-cfg = "0.0"
4040

41-
operators = { git = "https://github.com/YdrMaster/operators-rs", rev = "f872f7e", default-features = false }
41+
operators = { git = "https://github.com/YdrMaster/operators-rs", rev = "61789f7", default-features = false }
4242

4343
search-cl-tools = { git = "https://github.com/InfiniTensor/clrt", rev = "f69b160" }
4444
search-infini-tools = { git = "https://github.com/InfiniTensor/infini-rt", rev = "e8362c3" }

models/clip/common/src/compute.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use operators::{
55
add_rows::{self, AddRows},
66
attention::{self, Attention},
77
conv::{self, Conv},
8+
fuesd_softmax::AttnMask,
89
gelu::{self, Gelu},
910
layer_norm::{self, LayerNorm},
1011
mat_mul::{self, MatMul},
@@ -422,6 +423,7 @@ where
422423
v_base: v.base(),
423424
o_layout: o.layout(),
424425
o_base: o.base_mut(),
426+
mask: AttnMask::None,
425427
},
426428
workspace,
427429
queue_alloc,

models/gpt2/common/src/compute.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use operators::{
55
add_rows::{self, AddRows},
66
all_reduce::{self, AllReduce, ReduceOp},
77
attention_kv_cached::{self, AttnKVCached},
8+
fuesd_softmax::AttnMask,
89
gelu::{self, Gelu},
910
layer_norm::{self, LayerNorm},
1011
mat_mul::{self, MatMul},
@@ -399,6 +400,7 @@ where
399400
k_cache_base: kc.base_mut(),
400401
v_cache_layout: vc.layout(),
401402
v_cache_base: vc.base_mut(),
403+
mask: AttnMask::Causal,
402404
pos: pos.into(),
403405
},
404406
workspace,

models/llama/common/src/compute.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use itertools::izip;
77
use operators::{
88
all_reduce::{self, AllReduce, ReduceOp},
99
attention_kv_cached::{self, AttnKVCached},
10+
fuesd_softmax::AttnMask,
1011
mat_mul::{self, MatMul},
1112
rearrange::{self, Rearrange},
1213
rms_norm::{self, RmsNorm},
@@ -520,6 +521,7 @@ where
520521
k_cache_base: kc.base_mut(),
521522
v_cache_layout: vc.layout(),
522523
v_cache_base: vc.base_mut(),
524+
mask: AttnMask::Causal,
523525
pos: pos.into(),
524526
},
525527
workspace,

0 commit comments

Comments
 (0)