You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are steps how I do the initial optimization on Resnetmode:
Obtain TTIR from TT-Forge-FE compiler.
Run TT-Alchemist with enabled all pipeline options like in TT-Forge-FE to get TTNN code. Those options include enabling the optimizer, sharding and fusing passes.
Then I tried to run this generated model with bfloat8 data format. Before, I started I didn't know anything about compiler passes and how we actually generate the model in TTNN. I didn't know why it has that number of nodes, those types of nodes, why the nodes have those configurations. That's important, because if you try to change something randomly, you can face very easily TT-Metal constraints. So, you need to change things step by step.
First I tried to change data format of convolutions. To do that you need pass through all about 50 convolutions, and change, find and replace tool can help. My approach was, use find and replace, but don't do that in burst mode, don't change everything immediately, but one by one, I wanted to be sure I changed only convolutions. After, a few changes try to run code to see if compilation and running are successful. When I finish I run model to see if I can gain some perf.
In the same way then I changed the data format for all inputs for convolution operations. And, again, build and run, check perf.
Then change for binary operations and check.
Then check other operations, and change and check in the same way. This kind of step by step changing helps me to learn model, it's structure and operations, to learn configurations, and of course if something fails, I can easily write down what change introduced the error, and it's easier to undo it.
The most problematic step is if I want to change input shape, concretely batch size. There is a lot of dependencies between shapes in operations, in the whole code, and if we change something at the beginning, we nee to recalculate all shapes, that's almost impossible. The easiest is to generate new TTIR with new shapes, and repeat the whole process.
This is procedure for every feature, for every change we want to make. Data format, Math fidelity, sharding, etc.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
These are steps how I do the initial optimization on Resnetmode:
How to compile and run the model:
resnet50_hfand run command./runto execute the code. It is placed in filettnn-standaloneBeta Was this translation helpful? Give feedback.
All reactions