Super-hard

Implement QLoRA-style NF4 4-bit quantization of a weight matrix plus a LoRA adapter, verif

SFT, Instruction Tuning, Data & PEFT · Problem 5 of 6

Chapter 08SFT, Instruction Tuning, Data & PEFT

Implement QLoRA-style NF4 4-bit quantization of a weight matrix plus a LoRA adapter, verif

Super-hardProblem 5 / 6

Implement QLoRA-style NF4 4-bit quantization of a weight matrix plus a LoRA adapter, verifying the forward matches fp16++adapter within tolerance.

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints