MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / __init__

Method __init__

inference/modules/fused_mlp.py:19–39  ·  view source on GitHub ↗
(
        self,
        gate_proj,
        down_proj,
        up_proj,
    )

Source from the content-addressed store, hash-verified

17
18class QuantLlamaMLP(nn.Module):
19 def __init__(
20 self,
21 gate_proj,
22 down_proj,
23 up_proj,
24 ):
25 super().__init__()
26 self.register_buffer("gate_proj_qweight", gate_proj.qweight)
27 self.register_buffer("gate_proj_scales", gate_proj.scales)
28 self.register_buffer("gate_proj_qzeros", gate_proj.qzeros)
29 self.register_buffer("up_proj_qweight", up_proj.qweight)
30 self.register_buffer("up_proj_scales", up_proj.scales)
31 self.register_buffer("up_proj_qzeros", up_proj.qzeros)
32
33 self.in_features = gate_proj.in_features
34 self.intermediate_size = gate_proj.out_features
35 self.out_features = down_proj.out_features
36 self.w_bit = gate_proj.w_bit
37 self.down_proj = down_proj
38 self.split_k_iters = down_proj.split_k_iters
39 self.offset = 0x0F if self.w_bit == 4 else 0x03
40
41 def forward(self, x):
42 return self.down_proj(self.our_llama_mlp(x))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected