TorchDynamo: An Experiment in Dynamic Python Bytecode Transformation

Thanks for giving reply, So the guards are implemented in the modified bytecode. The process is as follows:

1. Tracing is performed on the original bytecode, which generates the FX graph.

2. The modified bytecode calls these FX graphs.

3. The guards reside within the modified bytecode.

4. If the metadata of the new input does not match the metadata of the nodes in the graph checked by the guard, the guard fails, triggering a retrace from the original bytecode.

No tracing on modifed byetcode.