From 36b312ab35a6a0410c000aec60adffd511dc9696 Mon Sep 17 00:00:00 2001 From: "Miguel Alonso Jr." <76960110+miguelalonsojr@users.noreply.github.com> Date: Fri, 4 Oct 2024 21:24:33 -0400 Subject: [PATCH] Bumped versions. (#6155) * Bumped versions. * Bumped versions. * Updated unity projects. * Updated version validation. * Fixed failing GPU test. --- DevProject/Packages/packages-lock.json | 2 +- DevProject/ProjectSettings/EditorBuildSettings.asset | 2 +- Project/Packages/packages-lock.json | 2 +- com.unity.ml-agents.extensions/package.json | 2 +- com.unity.ml-agents/package.json | 4 ++-- ml-agents-envs/mlagents_envs/__init__.py | 2 +- ml-agents/mlagents/torch_utils/torch.py | 2 +- ml-agents/mlagents/trainers/__init__.py | 2 +- ml-agents/mlagents/trainers/tests/test_torch_utils.py | 4 ++-- .../trainers/tests/torch_entities/test_attention.py | 4 ++-- utils/validate_versions.py | 11 +++++++---- 11 files changed, 20 insertions(+), 17 deletions(-) diff --git a/DevProject/Packages/packages-lock.json b/DevProject/Packages/packages-lock.json index 8eb2847fa1..fcb1b62a69 100644 --- a/DevProject/Packages/packages-lock.json +++ b/DevProject/Packages/packages-lock.json @@ -79,7 +79,7 @@ "depth": 0, "source": "local", "dependencies": { - "com.unity.ml-agents": "3.0.0-exp.1", + "com.unity.ml-agents": "3.0.0", "com.unity.modules.physics": "1.0.0" } }, diff --git a/DevProject/ProjectSettings/EditorBuildSettings.asset b/DevProject/ProjectSettings/EditorBuildSettings.asset index 7a81c6578a..2c895fce8b 100644 --- a/DevProject/ProjectSettings/EditorBuildSettings.asset +++ b/DevProject/ProjectSettings/EditorBuildSettings.asset @@ -9,6 +9,6 @@ EditorBuildSettings: path: Assets/ML-Agents/Scripts/Tests/Runtime/AcademyTest/AcademyStepperTestScene.unity guid: 9bafc50b1e55b43b2b1ae9620f1f8311 m_configObjects: - com.unity.ml-agents.settings: {fileID: 11400000, guid: b176c44294f5e434bb5109ddfc43274e, + com.unity.ml-agents.settings: {fileID: 11400000, guid: b9540ad82945942dd852207c48989240, type: 2} m_UseUCBPForAssetBundles: 0 diff --git a/Project/Packages/packages-lock.json b/Project/Packages/packages-lock.json index 274982a762..1fcbf50632 100644 --- a/Project/Packages/packages-lock.json +++ b/Project/Packages/packages-lock.json @@ -96,7 +96,7 @@ "depth": 0, "source": "local", "dependencies": { - "com.unity.ml-agents": "3.0.0-exp.1", + "com.unity.ml-agents": "3.0.0", "com.unity.modules.physics": "1.0.0" } }, diff --git a/com.unity.ml-agents.extensions/package.json b/com.unity.ml-agents.extensions/package.json index 71d3035c37..4f44bcd6c0 100644 --- a/com.unity.ml-agents.extensions/package.json +++ b/com.unity.ml-agents.extensions/package.json @@ -5,7 +5,7 @@ "unity": "2023.2", "description": "A source-only package for new features based on ML-Agents", "dependencies": { - "com.unity.ml-agents": "3.0.0-exp.1", + "com.unity.ml-agents": "3.0.0", "com.unity.modules.physics": "1.0.0" } } diff --git a/com.unity.ml-agents/package.json b/com.unity.ml-agents/package.json index e9f63002ef..b8987dd3d3 100755 --- a/com.unity.ml-agents/package.json +++ b/com.unity.ml-agents/package.json @@ -12,8 +12,8 @@ }, "samples": [ { - "displayName":"3D Ball", - "description":"The 3D Ball sample is a simple environment that is a great for jumping into ML-Agents to see how things work.", + "displayName": "3D Ball", + "description": "The 3D Ball sample is a simple environment that is a great for jumping into ML-Agents to see how things work.", "path": "Samples~/3DBall" } ] diff --git a/ml-agents-envs/mlagents_envs/__init__.py b/ml-agents-envs/mlagents_envs/__init__.py index c376dbb366..8fcd736651 100644 --- a/ml-agents-envs/mlagents_envs/__init__.py +++ b/ml-agents-envs/mlagents_envs/__init__.py @@ -1,5 +1,5 @@ # Version of the library that will be used to upload to pypi -__version__ = "1.1.0.dev0" +__version__ = "1.2.0.dev0" # Git tag that will be checked to determine whether to trigger upload to pypi __release_tag__ = None diff --git a/ml-agents/mlagents/torch_utils/torch.py b/ml-agents/mlagents/torch_utils/torch.py index ce1fec7a57..311304ef54 100644 --- a/ml-agents/mlagents/torch_utils/torch.py +++ b/ml-agents/mlagents/torch_utils/torch.py @@ -53,7 +53,7 @@ def set_torch_config(torch_settings: TorchSettings) -> None: if _device.type == "cuda": torch.set_default_device(_device.type) - torch.set_default_dtype(torch.cuda.FloatTensor) + torch.set_default_dtype(torch.float32) else: torch.set_default_dtype(torch.float32) logger.debug(f"default Torch device: {_device}") diff --git a/ml-agents/mlagents/trainers/__init__.py b/ml-agents/mlagents/trainers/__init__.py index c376dbb366..8fcd736651 100644 --- a/ml-agents/mlagents/trainers/__init__.py +++ b/ml-agents/mlagents/trainers/__init__.py @@ -1,5 +1,5 @@ # Version of the library that will be used to upload to pypi -__version__ = "1.1.0.dev0" +__version__ = "1.2.0.dev0" # Git tag that will be checked to determine whether to trigger upload to pypi __release_tag__ = None diff --git a/ml-agents/mlagents/trainers/tests/test_torch_utils.py b/ml-agents/mlagents/trainers/tests/test_torch_utils.py index f0d69e3564..a8e15a4a26 100644 --- a/ml-agents/mlagents/trainers/tests/test_torch_utils.py +++ b/ml-agents/mlagents/trainers/tests/test_torch_utils.py @@ -11,8 +11,8 @@ "device_str, expected_type, expected_index, expected_tensor_type", [ ("cpu", "cpu", None, torch.float32), - ("cuda", "cuda", None, torch.cuda.FloatTensor), - ("cuda:42", "cuda", 42, torch.cuda.FloatTensor), + ("cuda", "cuda", None, torch.float32), + ("cuda:42", "cuda", 42, torch.float32), ("opengl", "opengl", None, torch.float32), ], ) diff --git a/ml-agents/mlagents/trainers/tests/torch_entities/test_attention.py b/ml-agents/mlagents/trainers/tests/torch_entities/test_attention.py index f7344a647b..1a210987bc 100644 --- a/ml-agents/mlagents/trainers/tests/torch_entities/test_attention.py +++ b/ml-agents/mlagents/trainers/tests/torch_entities/test_attention.py @@ -1,5 +1,5 @@ import pytest -from mlagents.torch_utils import torch +from mlagents.torch_utils import torch, default_device import numpy as np from mlagents.trainers.torch_entities.utils import ModelUtils @@ -217,7 +217,7 @@ def test_predict_minimum_training(): argmin = argmin.squeeze() argmin = argmin.detach() sliced_oh = onehots[:, : num + 1] - inp = torch.cat([inp, sliced_oh], dim=2) + inp = torch.cat([inp, sliced_oh.to(default_device())], dim=2) embeddings = entity_embedding(inp, inp) masks = get_zero_entities_mask([inp]) diff --git a/utils/validate_versions.py b/utils/validate_versions.py index 65044ed5a8..36a230af0d 100755 --- a/utils/validate_versions.py +++ b/utils/validate_versions.py @@ -25,7 +25,8 @@ def _escape_non_none(s: Optional[str]) -> str: """ - Returns s escaped in quotes if it is non-None, else "None" + Returns s escaped in quotes if it is non-None, els e "None" + Returns s escaped in quotes if it is non-None, els e "None" :param s: :return: """ @@ -81,11 +82,13 @@ def set_version( f.write(new_contents) if csharp_version is not None: - package_version = f"{csharp_version}-exp.1" + # removed exp.1 tag from version strings since MLA package is a supported package again + # package_version = f"{csharp_version}-exp.1" + package_version = f"{csharp_version}" if csharp_extensions_version is not None: # since this has never been promoted we need to keep # it in preview forever or CI will fail - extension_version = f"{csharp_extensions_version}-exp.1" + extension_version = f"{csharp_extensions_version}-preview" print( f"Setting package version to {package_version} in {MLAGENTS_PACKAGE_JSON_PATH}" f" and {MLAGENTS_EXTENSIONS_PACKAGE_JSON_PATH}" @@ -178,7 +181,7 @@ def print_release_tag_commands( print(f"Updating C# package to version {args.csharp_version}") if args.csharp_extensions_version: print( - f"Updating C# extensions package to version {args.csharp_extensions_version}" + f"Updating C# extensions package to version {args.csharp_extensions_version}-exp.1" ) set_version( args.python_version,