feat: ia3 variant, real bnb 4bit/8bit smoke, dev guide split, user-only readme

This commit is contained in:
wassname
2026-04-26 17:49:17 +08:00
parent f2d9021511
commit 699fde31bf
11 changed files with 216 additions and 174 deletions
+1 -1
View File
@@ -1 +1 @@
from . import lora, pissa, delora # noqa: F401 side-effect: register
from . import lora, pissa, delora, ia3 # noqa: F401 side-effect: register
+22
View File
@@ -0,0 +1,22 @@
"""IA3-style output gating. y_new = y * g, with g initialized to ones."""
import torch
from torch import nn
from ..variant import register, ParamSpec
@register
class IA3:
name = "ia3"
@staticmethod
def param_specs(d_in, d_out, cfg):
return {"lora_g": ParamSpec((d_out,), init="ones", trainable=True)}
@staticmethod
def init(layer: nn.Linear, cfg) -> None:
return
@staticmethod
def forward(layer: nn.Linear, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
return y * layer.lora_g