Buckets:
| namespace neuroflow { | |
| class RMSNorm { | |
| public: | |
| size_t dim_; | |
| float eps_; | |
| Tensor weight_; | |
| struct Cache { | |
| Tensor input; | |
| Tensor rms; | |
| Tensor normalized; | |
| }; | |
| Cache cache_; | |
| RMSNorm(size_t dim, float eps = 1e-5f); | |
| Tensor forward(const Tensor& x); | |
| struct Gradients { | |
| Tensor weight_grad; | |
| Tensor input_grad; | |
| }; | |
| Gradients backward(const Tensor& output_grad); | |
| }; | |
| void launch_rms_norm_forward(float* out, const float* input, const float* weight, | |
| float* rms, float* normalized, size_t batch, size_t dim, | |
| float eps, cudaStream_t stream); | |
| void launch_rms_norm_backward(float* input_grad, float* weight_grad, | |
| const float* output_grad, const float* input, | |
| const float* rms, const float* normalized, | |
| const float* weight, size_t batch, size_t dim, | |
| cudaStream_t stream); | |
| } // namespace neuroflow | |
Xet Storage Details
- Size:
- 1.31 kB
- Xet hash:
- 5ec52cd9a531e14b4eae5a1e45127b983781d3594a7b2163ff9c068a2a65cc21
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.