Two code patterns that caused every torch.compile graph break in Keras's PyTorch backend
PyTorch Forums
Two code patterns that caused every torch.compile graph break in Keras's PyTorch backend
Over the summer I removed the torch.compile graph breaks from Keras’s PyTorch backend. In my two test models, every break came from one of two small patterns. Both are easy to write into framework code without noticing, so here they are. A graph break is a spot where Dynamo stops tracing and falls back to Python. I counted them with torch._dynamo.explain on torch 2.13.0. Pattern 1: a C++ object built inside a capability check Keras’s attention op asked “can flash attention run here?” on eve...
0 comments
No comments yet.