Skip to content

feat(nn): make Linear open for adapter subclasses#875

Merged
michalharakal merged 1 commit into
developfrom
feature/linear-open
Jul 24, 2026
Merged

feat(nn): make Linear open for adapter subclasses#875
michalharakal merged 1 commit into
developfrom
feature/linear-open

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

What

Marks Linear as open so adapter-style layers can subclass it — the LoRA pattern (class LinearWithLoRA : Linear) that augments onForward with a low-rank update and params with the A/B matrices, while reusing the frozen base projection.

No behavioral change and no new members: the override points (onForward, params) were already open via Module / ModuleParameters; only the class itself was final. API dumps updated (the now-visible protected onForward surfaces in the dump because the class is subclassable).

Motivation

Completes the toolkit for parameter-efficient finetuning on top of SKaiNET: with bias-less Linear (#870) and this change, an educational GPT port can express LoRA as a small subclass instead of reimplementing the layer. Follows the same from-scratch-then-upstream pattern as #866 (LR schedules), #867 (Dropout), #870 (bias-less Linear).

Marks Linear as open so adapter-style layers (LoRA and similar) can
subclass it and augment onForward or params while reusing the base
projection. No behavioral change; the override points (onForward, params)
were already open via Module.
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-875 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal requested a review from aharakal July 24, 2026 10:45
@michalharakal
michalharakal merged commit 49c8879 into develop Jul 24, 2026
16 checks passed
@michalharakal
michalharakal deleted the feature/linear-open branch July 24, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants