ahrefs / ocannl

OCANNL: OCaml Compiles Algorithms for Neural Networks Learning
BSD 2-Clause "Simplified" License
67 stars 2 forks source link

Refactor backends to two layers of sharing: C-syntax ("c", "cuda", "metal") and CUDA-like ("cuda", "metal"?) #268

Closed lukstafi closed 4 months ago

lukstafi commented 5 months ago

Multiple options of how to approach it, e.g. could be just a helper module. Or could be classes with inheritance, where Backends would convert from a class to a module. Or could be a functor. The helper module approach could provide a function taking a record argument, that's almost a functor.

lukstafi commented 4 months ago

The C-syntax part is refactored now. I'm not sure if there are sufficient extra commonalities for another layer of refactoring, that's not just "GPU optimization". GPU optimization is not a refactoring because we don't have that yet.