Skip to content

Commit dd4bc26

Browse files
committed
tmp
t t
1 parent ec71d13 commit dd4bc26

File tree

7 files changed

+181
-114
lines changed

7 files changed

+181
-114
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ itertools = "0.13"
4141
env_logger = "0.11"
4242
build-script-cfg = "0.0"
4343

44-
operators = { git = "https://github.com/YdrMaster/operators-rs", rev = "61789f7", default-features = false }
44+
operators = { git = "https://github.com/onenewcode/operators-rs", branch = "dev", default-features = false }
4545

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

models/minicpm3/common-cpu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ common.workspace = true
1212
operators = { workspace = true, features = ["common-cpu"] }
1313

1414
[dev-dependencies]
15-
test-utils = { workspace = true, features = ["llama"] }
15+
test-utils.workspace = true
1616
gguf.workspace = true
1717
regex.workspace = true

models/minicpm3/common-cpu/src/infer.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ fn test_infer() {
151151

152152
let senders = senders.into_boxed_slice();
153153
barrier.wait();
154-
test_infer_paralle(&model, senders, eos, tokenizer, &prompt, max_steps)
154+
test_infer_paralle(
155+
senders,
156+
test_utils::AboutToken {
157+
tokenizer,
158+
token_embd: model.token_embd,
159+
nvoc: model.meta.nvoc,
160+
eos,
161+
},
162+
&prompt,
163+
max_steps,
164+
)
155165
})
156166
}

models/minicpm3/common-cpu/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ where
3737
type Rope = op!(rope);
3838
type Attention = op!(attention);
3939
type RmsNorm = op!(rms_norm);
40+
type Add = op!(add);
4041
type MatMul = op!(mat_mul);
4142
type Swiglu = op!(swiglu);
4243
type Rearrange = op!(rearrange);
@@ -112,6 +113,8 @@ impl WeightLoader for Weights<'_> {
112113
ffn_norm,
113114
ffn_gate_up,
114115
ffn_down,
116+
ffn_gate,
117+
ffn_up,
115118
} = &self.blks[iblk];
116119
use MiniCPM3BlkWeight as W;
117120
match which {
@@ -126,6 +129,8 @@ impl WeightLoader for Weights<'_> {
126129
W::FfnNorm => ffn_norm,
127130
W::FfnGateUp => ffn_gate_up,
128131
W::FfnDown => ffn_down,
132+
W::FfnGate => ffn_gate,
133+
W::FfnUp => ffn_up,
129134
}
130135
}
131136

0 commit comments

Comments
 (0)