Skip to content

refactor(llm): Split layers.py by layer type #142

Closed

Description

@m96-chan

Problem

src/pygpukit/llm/layers.py is 1491 lines with all layer implementations.

Current State

src/pygpukit/llm/
└── layers.py  (1491 lines - all layers)

Proposed Structure

src/pygpukit/llm/layers/
├── __init__.py          (exports)
├── base.py              (BaseLayer)
├── attention.py         (Attention, GQA, MHA)
├── mlp.py               (MLP, GatedMLP, SwiGLU)
├── norm.py              (RMSNorm, LayerNorm wrappers)
├── embedding.py         (TokenEmbedding, PositionEmbedding)
└── block.py             (TransformerBlock)

Benefits

  • Each layer type in its own file
  • Easier to understand layer implementations
  • Clear dependencies between layers
  • Easier testing per layer type

Related

Activity

  1. m96-chan commented on Dec 30, 2025

    @m96-chan
    OwnerAuthor

    Completed in PR #168

  2. added a commit that references this issue on Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions