char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Zijun Yuopenvino: OV 2026.2, context-shift, Q5_1 support, gemma4 dense/embedding, and -fa off (#24503)890f1a27e

char/aliceai-t5-moe
1.2 KiB38 linesraw
1#include "../node_context.h"
2#include "../op_table.h"
3#include "../utils.h"
4
5#include <openvino/op/abs.hpp>
6#include <openvino/op/add.hpp>
7#include <openvino/op/constant.hpp>
8#include <openvino/op/exp.hpp>
9#include <openvino/op/log.hpp>
10#include <openvino/op/negative.hpp>
11#include <openvino/op/relu.hpp>
12
13namespace ov {
14namespace frontend {
15namespace ggml {
16namespace op {
17
18OutputVector translate_unary_softplus(const NodeContext & context) {
19    num_inputs_check(context, 1, 1);
20
21    auto input = process_view_input_new(context, 0);
22    const auto element_type = input.get_element_type();
23    auto one = ov::op::v0::Constant::create(element_type, ov::Shape{}, {1.0f});
24
25    auto positive = std::make_shared<ov::op::v0::Relu>(input);
26    auto abs = std::make_shared<ov::op::v0::Abs>(input);
27    auto neg_abs = std::make_shared<ov::op::v0::Negative>(abs);
28    auto exp_neg_abs = std::make_shared<ov::op::v0::Exp>(neg_abs);
29    auto log_term = std::make_shared<ov::op::v0::Log>(std::make_shared<ov::op::v1::Add>(one, exp_neg_abs));
30    auto res = std::make_shared<ov::op::v1::Add>(positive, log_term);
31
32    return rename_outputs_with_suffix({res}, context.get_name());
33}
34
35}  // namespace op
36}  // namespace ggml
37}  // namespace frontend
38}  // namespace ov