payload: {"push_id":3699598212,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"0c82cd4128019b60546e4c13984b4e6d70aaa67b","before":"d16eb80eaccb1eb3fbaac0c389e5611e6416e5f9","commits":[{"sha":"0c82cd4128019b60546e4c13984b4e6d70aaa67b","author":{"name":"Alexey Radul","email":"e32449907b5701da15d8e9d5fe4b410cc946200a@google.com"},"message":"Implement tail-call optimization.\n\nIn general, TCO helps because\n- Data stacks do not grow at tail calls, reducing asymptotic memory cost.\n  - This was already happening because dead arguments (which, in a tail call,\n    are all of them) were being popped before entering the callee.\n- Don't need to push data into stacks at tail calls, reducing stack traffic.\n  - Not doing this -- will be subsumed by general pop-push elimination.\n- It avoids stack traffic on copying the answer, since the callee already\n  put it in the right place.\n  - Would be redundant with a general redundant write elimination pass,\n    but don't have that yet.\n- It avoids stack traffic and memory use pushing and popping the program counter.\n\nIn particular, this means that iterative loops (if coded as self-tail-recursive functions) will now run in constant memory, and with somewhat reduced data copying.\n\nOn the NUTS program, that adds up to a 2x reduction in maximum stack depth.\n\nPiperOrigin-RevId: 252485302","distinct":true,"url":"https://api.github.com/repos/tensorflow/probability/commits/0c82cd4128019b60546e4c13984b4e6d70aaa67b"}]}
other: {"actor":{"display_login":"tensorflow-copybara"}}