-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
dynamo-perfImpacts dynamo perfImpacts dynamo perfdynamo-triage-june2024enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: dynamomodule: guardsoncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
Currently, TorchDynamo calls PyFrame_FastToLocalsWithError (docs).
Internally in cpython, this converts between the "frame fast variables" (a flat C array of PyObject*) and frame->f_locals (a python dictionary).
frame->f_locals starts as NULL, and is only populated by this function.
This works, but is higher overhead than it needs to be.
We should rewrite the generated guards to use the "fast variables" data structure directly.
cc @ezyang @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @msaroufim @zou3519 @aakhundov @soumith @wconstab @ngimel @yanboliang @Xia-Weiwen @desertfire
Metadata
Metadata
Assignees
Labels
dynamo-perfImpacts dynamo perfImpacts dynamo perfdynamo-triage-june2024enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: dynamomodule: guardsoncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module