(self, cfg: Config, *, parent: Module)
| 285 | ) |
| 286 | |
| 287 | def __init__(self, cfg: Config, *, parent: Module): |
| 288 | super().__init__(cfg, parent=parent) |
| 289 | cfg = self.config |
| 290 | self._add_child( |
| 291 | "lora_down", |
| 292 | cfg.lora_down.set( |
| 293 | model_dim=cfg.rank, |
| 294 | num_heads=cfg.num_heads, |
| 295 | per_head_dim=self._per_head_dim, |
| 296 | bias=False, |
| 297 | ), |
| 298 | ) |
| 299 | self._add_child( |
| 300 | "lora_up", |
| 301 | cfg.lora_up.set( |
| 302 | input_dim=cfg.rank, |
| 303 | output_dim=cfg.output_dim, |
| 304 | bias=False, |
| 305 | param_init=DefaultInitializer.default_config().set( |
| 306 | init_by_param_name={ |
| 307 | PARAM_REGEXP_WEIGHT: ConstantInitializer.default_config().set(value=0.0) |
| 308 | } |
| 309 | ), |
| 310 | ), |
| 311 | ) |
| 312 | |
| 313 | |
| 314 | class LoraFusedQKVAdapter(_BaseLoraAdapter): |
nothing calls this directly
no test coverage detected