tenstorrent / tt-metal

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

FD2.1 fix compile optimization flags #7449

Open pgkeller opened 4 months ago

pgkeller commented 4 months ago

brisc/ncrisc are currently compiled w/ -Os for legacy reasons this results in the compiler not inlining most fns necessitating the use of FORCE_INLINE which isn't alway the right answer we should compile these kernels w/ -O3 by default however, some kernels may get too big w/ -O3, so at the time of the change we should add a kernel argument for optimization level, at least to go from -O3 to -Os (and maybe O1 and O1?). users should have some API recourse if their kernel doesn't fit

we should also consider compiling the firmware w/ -Os as most of firmware is initialization code, though we need to confirm the kernel launch code doesn't suffer...

davorchap commented 4 months ago

@tooniz mentioned that -g is used by default and causing RISCV code size increase ?

pgkeller commented 4 months ago

@tooniz mentioned that -g is used by default and causing RISCV code size increase ?

Yes, need to look into that too. I'm surprised that -g affects code size (and not just meta data), certainly we don't want to pay that cost by default