the yaml thing is not a switch statement though. torchgen takes native_functions.yaml and generates the bindings, autograd nodes and dispatch entries from that one file.
there are ~~3700 ops. try keeping that in sync by hand.
also dynamo never calls gcc. it just captures the graph from python bytecode. inductor is what writes triton/cpp and sends it to real compilers. they built their own compiler stack once (torchscript), it's dead now.
so this time they reused what exists.
spaghetti yes. 10 years of layers. you can see every era in the repo.
the yaml thing is not a switch statement though. torchgen takes native_functions.yaml and generates the bindings, autograd nodes and dispatch entries from that one file. there are ~~3700 ops. try keeping that in sync by hand.
also dynamo never calls gcc. it just captures the graph from python bytecode. inductor is what writes triton/cpp and sends it to real compilers. they built their own compiler stack once (torchscript), it's dead now. so this time they reused what exists.
spaghetti yes. 10 years of layers. you can see every era in the repo.