Ling-3.0-tiny-RKNN / src /mla_npu.h
Sariel00's picture
Publish Ling-3.0-tiny RKNN engine and model
3fd1a35 verified
Raw History Blame Contribute Delete
703 Bytes
#pragma once
#include "ling3/mla_stats.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <span>
#include <string>
namespace ling3 {
// One workspace per decoder, shared by all six MLA layers. No persistent KV:
// checkpoint/rewind semantics continue to belong to the decoder's BF16 cache.
class MlaNpu {
public:
MlaNpu();
~MlaNpu();
void Prepare(std::size_t rows);
bool Run(std::span<const float> q, std::span<const std::uint16_t> k,
std::span<const std::uint16_t> v, std::size_t rows, std::size_t history,
std::span<float> output);
void CpuCall();
MlaBackendStats Stats() const;
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
}