Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions ggml/src/ggml-spacemit/ime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1860,10 +1860,6 @@ class tensor_traits_f16 : public ggml::spacemit::tensor_traits_base {
const int ith = ctx.ith;
const int nth = ctx.nth;

if (ith == 0 && getenv("GGML_SPACEMIT_Q41_TRACE") != nullptr) {
fprintf(stderr, "q41_mul_mat: N=%zu M=%zu K=%zu (%s)\n", N, M, K, M == 1 ? "decode" : "prefill");
}

const size_t out_row_stride = dst->nb[1]; // bytes

constexpr size_t m_tile = F16_M_TILE;
Expand Down
5 changes: 5 additions & 0 deletions ggml/src/ggml-spacemit/rvv_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4109,7 +4109,9 @@ void forward_scale_f32(ggml::spacemit::context & ctx, ggml_tensor * op) {
GGML_ASSERT(src0->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32);

float scale;
float bias;
memcpy(&scale, op->op_params, sizeof(float));
memcpy(&bias, (const char *) op->op_params + sizeof(float), sizeof(float));

const int64_t ith = ctx.ith;
const int64_t nth = ctx.nth;
Expand All @@ -4136,6 +4138,9 @@ void forward_scale_f32(ggml::spacemit::context & ctx, ggml_tensor * op) {
const size_t vl = __riscv_vsetvl_e32m4(remaining);
vfloat32m4_t v = __riscv_vle32_v_f32m4(src_row, vl);
v = __riscv_vfmul_vf_f32m4(v, scale, vl);
if (bias != 0.0f) {
v = __riscv_vfadd_vf_f32m4(v, bias, vl);
}
__riscv_vse32_v_f32m4(dst_row, v, vl);
src_row += vl;
dst_row += vl;
Expand Down
Loading