Trainium gets a bad rap in the AI industry too much. I think it is very valuable for $AMZN.
Trainium is excellent hardware in general and can be extremely performant if you use NKI and write everything hand tuned.
The Neuron compiler also has very sophisticated code generation. This is something I do not hear talked about much. Neuron compiler can codegen entire Transformers layers. Now I still think NKI is faster, but if you do not need roofline performance you can use the compiler codegeneration.
TPU codegen is still much better than Trainium but I would put Trainium definitely up there in terms of codegen quality.