From CUDA and Jax to TorchTPU: Lessons from a Cayley Graph Solver

https://andlukyane.com/blog/cayley-graphs-and-torchtpu

Comments

xiaoliangliangNov 25, 2026, 3:23 AM
[flagged]
fl1pperNov 24, 2026, 10:17 PM
With T=51 and head_dim=32 giving only ~2.5% MXU tile occupancy, did you consider packing multiple puzzle states into a single tile while keeping their attention independent? Or does XLA already exploit the batch dimension for this?
ArtgorNov 25, 2026, 7:51 AM
Good question. As far as I know, XLA won't do it on its own: both attention operands are different for each state, so there's no shared operand to fold the batch into - each small 51×32 tile gets padded separately.

I haven't tried packing yet, but I think it could work. In my benchmarking experiments, StableHLO attention at T=256 was 2.6x faster than at T=51. The only extra cost would be the block-diagonal mask.

I can try it. In fact, it would be easier and better to change the model architecture so that it fits hardware better. It just won't work as a comparison.