|
| 1 | +# ML-Agents Versioning |
| 2 | + |
| 3 | +## Context |
| 4 | +As the ML-Agents project evolves into a more mature product, we want to communicate the process |
| 5 | +we use to version our packages and the data that flows into, through, and out of them clearly. |
| 6 | +Our project now has four packages (1 Unity, 3 Python) along with artifacts that are produced as |
| 7 | +well as consumed. This document covers the versioning for these packages and artifacts. |
| 8 | + |
| 9 | +## GitHub Releases |
| 10 | +Up until now, all packages were in lockstep in-terms of versioning. As a result, the GitHub releases |
| 11 | +were tagged with the version of all those packages (e.g. v0.15.0, v0.15.1) and labeled accordingly. |
| 12 | +With the decoupling of package versions, we now need to revisit our GitHub release tagging. |
| 13 | +The proposal is that we move towards an integer release numbering for our repo and each such |
| 14 | +release will call out specific version upgrades of each package. For instance, with the May release, |
| 15 | +we will have: |
| 16 | +- GitHub Release 1 (branch name: “release_1_branch) |
| 17 | + - com.unity.ml-agents release 1.0.0 |
| 18 | + - ml-agents release 0.16.0 |
| 19 | + - ml-agents-envs release 0.16.0 |
| 20 | + - gym-unity release 0.16.0 |
| 21 | + |
| 22 | +Our release cadence will not be affected by these versioning changes. We will keep having |
| 23 | +monthly releases to fix bugs and release new features. |
| 24 | + |
| 25 | +## Packages |
| 26 | +All of the software packages, and their generated artifacts will be versioned. Any automation |
| 27 | +tools will not be versioned. |
| 28 | + |
| 29 | +### Unity package |
| 30 | +Package name: com.unity.ml-agents |
| 31 | +- Versioned following [Semantic Versioning Guidelines](https://www.semver.org) |
| 32 | +- This package consumes an artifact of the training process: the `.nn` file. These files |
| 33 | + are integer versioned and currently at version 2. The com.unity.ml-agents package |
| 34 | + will need to support the version of `.nn` files which existed at its 1.0.0 release. |
| 35 | + For example, consider that com.unity.ml-agents is at version 1.0.0 and the NN files |
| 36 | + are at version 2. If the NN files change to version 3, the next release of |
| 37 | + com.unity.ml-agents at version 1.1.0 guarantees it will be able to read both of these |
| 38 | + formats. If the NN files were to change to version 4 and com.unity.ml-agents to |
| 39 | + version 2.0.0, support for NN versions 2 and 3 could be dropped for com.unity.ml-agents |
| 40 | + version 2.0.0. |
| 41 | +- This package produces one artifact, the `.demo` files. These files will have integer |
| 42 | + versioning. This means their version will increment by 1 at each change. The |
| 43 | + com.unity.ml-agents package must be backward compatible with version changes |
| 44 | + that occur between minor versions. |
| 45 | +- To summarize, the artifacts produced and consumed by com.unity.ml-agents are guaranteed |
| 46 | + to be supported for 1.x.x versions of com.unity.ml-agents. We intend to provide stability |
| 47 | + for our users by moving to a 1.0.0 release of com.unity.ml-agents. |
| 48 | + |
| 49 | + |
| 50 | +### Python Packages |
| 51 | +Package names: ml-agents / ml-agents-envs / gym-unity |
| 52 | +- The python packages remain in "Beta." This means that breaking changes to the public |
| 53 | + API of the python packages can change without having to have a major version bump. |
| 54 | + Historically, the python and C# packages were in version lockstep. This is no longer |
| 55 | + the case. The python packages will remain in lockstep with each other for now, while the |
| 56 | + C# package will follow its own versioning as is appropriate. However, the python package |
| 57 | + versions may diverge in the future. |
| 58 | +- While the python packages will remain in Beta for now, we acknowledge that the most |
| 59 | + heavily used portion of our python interface is the `mlagents-learn` CLI and strive |
| 60 | + to make this part of our API backward compatible. We are actively working on this and |
| 61 | + expect to have a stable CLI in the next few weeks. |
| 62 | + |
| 63 | +## Communicator |
| 64 | + |
| 65 | +Packages which communicate: com.unity.ml-agents / ml-agents-envs |
| 66 | + |
| 67 | +Another entity of the ML-Agents Toolkit that requires versioning is the communication layer |
| 68 | +between C# and Python, which will follow also semantic versioning. This guarantees a level of |
| 69 | +backward compatibility between different versions of C# and Python packages which communicate. |
| 70 | +Any Communicator version 1.x.x of the Unity package should be compatible with any 1.x.x |
| 71 | +Communicator Version in Python. |
| 72 | + |
| 73 | +An RLCapabilities struct keeps track of which features exist. This struct is passed from C# to |
| 74 | +Python, and another from Python to C#. With this feature level granularity, we can notify users |
| 75 | +more specifically about feature limitations based on what's available in both C# and Python. |
| 76 | +These notifications will be logged to the python terminal, or to the Unity Editor Console. |
| 77 | + |
| 78 | + |
| 79 | +## Side Channels |
| 80 | + |
| 81 | +The communicator is what manages data transfer between Unity and Python for the core |
| 82 | +training loop. Side Channels are another means of data transfer between Unity and Python. |
| 83 | +Side Channels are not versioned, but have been designed to support backward compatibility |
| 84 | +for what they are. As of today, we provide 4 side channels: |
| 85 | +- FloatProperties: shared float data between Unity - Python (bidirectional) |
| 86 | +- RawBytes: raw data that can be sent Unity - Python (bidirectional) |
| 87 | +- EngineConfig: a set of numeric fields in a pre-defined order sent from Python to Unity |
| 88 | +- Stats: (name, value, agg) messages sent from Unity to Python |
| 89 | + |
| 90 | +Aside from the specific implementations of side channels we provide (and use ourselves), |
| 91 | +the Side Channel interface is made available for users to create their own custom side |
| 92 | +channels. As such, we guarantee that the built in SideChannel interface between Unity and |
| 93 | +Python is backward compatible in packages that share the same major version. |
| 94 | + |
0 commit comments