Skip to content

feat: CUDA backward for LSTM, Attention, BatchNorm, LayerNorm, Embedding, Pooling #161

Description

@ulises-jeremias

Only Linear and Conv2D have CUDA backward. All other layers lack GPU backward:
LSTM, Attention, BatchNorm, LayerNorm, Embedding, MaxPool, Dropout (training mode).
This blocks full GPU training for models using these layers.

Task

For each layer type, add CUDA backward kernels:

  • nn/internal/lstm_backward_cuda_d_cuda.v
  • nn/internal/attention_backward_cuda_d_cuda.v
  • nn/internal/batchnorm_backward_cuda_d_cuda.v
  • nn/internal/layer_norm_backward_cuda_d_cuda.v
  • nn/internal/embedding_backward_cuda_d_cuda.v
  • nn/internal/pool_backward_cuda_d_cuda.v

Verification

  • Each backward matches CPU reference within 1e-4 relative error
  • Gradient check utility confirms correctness

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions