std1.0.0-beta-7 SafeC docs

std :: ml::lora

Struct std::QLoraMlp

#include <std/ml/lora.h> source

struct QLoraMlp {
    struct Vec<struct Nf4Tensor> W;
    struct Vec<&FloatTensor> bias;
    struct Vec<&FloatTensor> A;
    struct Vec<&FloatTensor> B;
    unsigned long nLayers;
    int act;
    int outAct;
    struct LoraConfig cfg;
    float scale;
    struct Rng rng;
}

Copies the base: weights to NF4, biases as float32, all frozen. The base Mlp may be freed afterwards.

Fields

§struct Vec<struct Nf4Tensor> Wsource
§struct Vec<&FloatTensor> biassource
§unsigned long nLayerssource
§int actsource
§int outActsource
§float scalesource
§struct Rng rngsource

Methods

§void collect_params(&Vec<&FloatTensor> out) constsource · definition

Parameterized (module.h): the adapters, as for LoraMlp.

§void collect_state(&Vec<&FloatTensor> out) constsource · definition
§unsigned long base_bytes() constsource · definition

the frozen base at rest

§void drop()source · definition
§void free() consumesource · definition

= drop()

§static struct QLoraMlp attach( const &Mlp base, const &LoraConfig cfg, unsigned long blockSize, int doubleQuant, )source · definition