[3.14] Add python version adjustment for frame count changes#168190
[3.14] Add python version adjustment for frame count changes#168190fxdawnn wants to merge 2 commits intogh/fxdawnn/13/basefrom
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/168190
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a033cda with merge base 7a92839 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
williamwen42
left a comment
There was a problem hiding this comment.
hmm, interesting that 3.13 seems to be affected by this too?
waiting for CI changes to confirm. |
``sys.getrefcount(lib)`` got impacted due to python3.13 optimization. ``sys.getrefcount(lib._op_impls)`` and others remain the same. Test plan: ``python test/test_python_dispatch.py TestPythonRegistration.test_finalizer`` in local ``python=3.14`` env [ghstack-poisoned]
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
| # 1 for `lib`, 1 for sys.getrefcount' for previous python version (<=3.12) | ||
| # In Python 3.13+, sys.getrefcount() was optimized to not create | ||
| # a temporary reference, so expected counts are 1 less than before | ||
| expected_refcount = 1 if sys.version_info >= (3, 14) else 2 |
There was a problem hiding this comment.
do we generally hardcode this type of information in code - wondering if we have config files to track such changes @williamwen42?
``sys.getrefcount(lib)`` got impacted due to python3.13 optimization. ``sys.getrefcount(lib._op_impls)`` and others remain the same. Test plan: ``python test/test_python_dispatch.py TestPythonRegistration.test_finalizer`` in local ``python=3.14`` env Pull Request resolved: #168190 Approved by: https://github.com/williamwen42, https://github.com/azahed98
Stack from ghstack (oldest at bottom):
sys.getrefcount(lib)got impacted due to python3.13 optimization.sys.getrefcount(lib._op_impls)and others remain the same.Test plan:
python test/test_python_dispatch.py TestPythonRegistration.test_finalizerin localpython=3.14env