tenstorrent / tt-metal

:metal: TT-NN operator library, and TT-Metalium low level kernel programming model.
Apache License 2.0
381 stars 47 forks source link

Refactor common model code #10342

Open yieldthought opened 1 month ago

yieldthought commented 1 month ago

Goal: Build up reusable modules and code in models.common.* and refactor existing models to use them.

Approach: Step-by-step replacement of common modules, then supporting e.g. test code

Expected challenges: different models doing different things around weight loading, cache naming schemes etc.

Initial targets: In order, later ones expected to change as things are learned from the earlier ones.

yieldthought commented 1 month ago

In progress: RMSNorm refactor.

Model Starting size Current size Lines of code
Mixtral 2987 2878 -109
Mistral 2289 2224 -65
Lines of code
Models -172
Common +81
Overall -91
davorchap commented 1 month ago

this is amazing!