[BE] bump optree version to 0.12.1 (#130139)

0.12.0 Major Updates:

- Add context manager to temporarily set the dictionary sorting mode
- Add accessor APIs
- Use `stable` tag for `pybind11` for Python 3.13 support
- Fix potential segmentation fault for pickling support

0.12.1 Updates:

- Fix warning regression during import when launch with strict warning filters

Closes #130155
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130139
Approved by: https://github.com/zou3519
ghstack dependencies: #130895
This commit is contained in:
Xuehai Pan
2024-07-19 22:09:53 +08:00
committed by PyTorch MergeBot
parent 50436d5bdb
commit d2bd9acabd
13 changed files with 15 additions and 16 deletions

View File

@ -134,9 +134,9 @@ opt-einsum==3.3
#Pinned versions: 3.3
#test that import: test_linalg.py
optree==0.11.0
optree==0.12.1
#Description: A library for tree manipulation
#Pinned versions: 0.11.0
#Pinned versions: 0.12.1
#test that import: test_vmap.py, test_aotdispatch.py, test_dynamic_shapes.py,
#test_pytree.py, test_ops.py, test_control_flow.py, test_modules.py,
#common_utils.py, test_eager_transforms.py, test_python_dispatch.py,

View File

@ -1,4 +1,4 @@
# iOS simulator requirements
coremltools==5.0b5
protobuf==3.20.2
optree==0.11.0
optree==0.12.1

View File

@ -26,7 +26,7 @@ pytest-cpp==2.3.0
rockset==1.0.3
z3-solver==4.12.2.0
tensorboard==2.13.0
optree==0.11.0
optree==0.12.1
# NB: test_hparams_* from test_tensorboard is failing with protobuf 5.26.0 in
# which the stringify metadata is wrong when escaping double quote
protobuf==3.20.2

View File

@ -188,7 +188,7 @@ jobs:
run: |
pushd "${PYTORCH_FINAL_PACKAGE_DIR}"
# shellcheck disable=SC2046,SC2102
python3 -mpip install $(echo *.whl)[opt-einsum,optree]
python3 -mpip install $(echo *.whl)[opt-einsum,optree] optree==0.12.1
popd
.ci/pytorch/win-test.sh

View File

@ -152,7 +152,7 @@ init_command = [
'junitparser==2.1.1',
'rich==10.9.0',
'pyyaml==6.0.1',
'optree==0.11.0',
'optree==0.12.1',
]
[[linter]]

View File

@ -20,4 +20,4 @@ ninja
# setuptools was removed from default python install
setuptools ; python_version >= "3.12"
packaging
optree>=0.11.0 ; python_version <= "3.12"
optree>=0.12.0

View File

@ -1201,7 +1201,7 @@ def main():
install_requires += extra_install_requires
extras_require = {
"optree": ["optree==0.11.0"],
"optree": ["optree>=0.12.0"],
"opt-einsum": ["opt-einsum>=3.3"],
}

View File

@ -3404,7 +3404,7 @@ class TestComposability(TestCase):
@onlyCPU
def test_no_warning_on_import_functorch(self, device):
out = subprocess.check_output(
[sys.executable, "-W", "all", "-c", "import functorch"],
[sys.executable, "-W", "always", "-c", "import functorch"],
stderr=subprocess.STDOUT,
cwd=os.path.dirname(os.path.realpath(__file__)),
).decode("utf-8")

View File

@ -1479,7 +1479,7 @@ assert KinetoStepTracker.current_step() == initial_step + 2 * niters
"""
try:
subprocess.check_output(
[sys.executable, "-W", "all", "-c", script],
[sys.executable, "-W", "always", "-c", script],
cwd=os.path.dirname(os.path.realpath(__file__)),
)
except subprocess.CalledProcessError as e:

View File

@ -11598,7 +11598,7 @@ class TestFallbackWarning(TestCase):
# TODO: Remove once test_testing.py is running on MPS devices
def test_no_warning_on_import(self):
out = subprocess.check_output(
[sys.executable, "-W", "all", "-c", "import torch"],
[sys.executable, "-W", "always", "-c", "import torch"],
stderr=subprocess.STDOUT,
# On Windows, opening the subprocess with the default CWD makes `import torch`
# fail, so just set CWD to this script's directory
@ -11640,11 +11640,10 @@ with warnings.catch_warnings(record=True) as w:
if len(w) != 1:
print(w)
exit(2)
"""
try:
subprocess.check_output(
[sys.executable, '-W', 'all', '-c', script],
[sys.executable, '-W', 'always', '-c', script],
stderr=subprocess.STDOUT,
# On Windows, opening the subprocess with the default CWD makes `import torch`
# fail, so just set CWD to this script's directory

View File

@ -887,7 +887,7 @@ exit(len(w))
"""
try:
subprocess.check_output(
[sys.executable, '-W', 'all', '-c', script],
[sys.executable, '-W', 'always', '-c', script],
stderr=subprocess.STDOUT,
# On Windows, opening the subprocess with the default CWD makes `import torch`
# fail, so just set CWD to this script's directory

View File

@ -2216,7 +2216,7 @@ class TestImports(TestCase):
@classmethod
def _check_python_output(cls, program) -> str:
return subprocess.check_output(
[sys.executable, "-W", "all", "-c", program],
[sys.executable, "-W", "always", "-c", program],
stderr=subprocess.STDOUT,
# On Windows, opening the subprocess with the default CWD makes `import torch`
# fail, so just set CWD to this script's directory

View File

@ -273,7 +273,7 @@ def tree_flatten(
>>> from collections import OrderedDict
>>> tree = OrderedDict([('b', (2, [3, 4])), ('a', 1), ('c', None), ('d', 5)])
>>> tree_flatten(tree)
([2, 3, 4, 1, None, 5], PyTreeSpec(OrderedDict([('b', (*, [*, *])), ('a', *), ('c', *), ('d', *)]), NoneIsLeaf))
([2, 3, 4, 1, None, 5], PyTreeSpec(OrderedDict({'b': (*, [*, *]), 'a': *, 'c': *, 'd': *}), NoneIsLeaf))
Args:
tree (pytree): A pytree to flatten.