Skip to content

A new training mode called "both" has been added. This allows simultaneous training with both PPO and SAC, each on a separate instance. For example, if you have 4 environments, the even-numbered ones will use PPO, and the odd-numbered ones will use SAC. Therefore, it's necessary to specify even values for num_envs. #6233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
44eb2bd
Updated version numbers. (#5993)
miguelalonsojr Oct 9, 2023
a4973ce
Updating release 20 -> release 21 in docs and docstrings.
miguelalonsojr Oct 9, 2023
005ace3
Release fixes.
miguelalonsojr Oct 9, 2023
af47660
Updated README version table.
miguelalonsojr Oct 9, 2023
97386af
Updated push to pypi gha.
miguelalonsojr Oct 9, 2023
f3dc8f6
Bumped numpy version. (#5997)
miguelalonsojr Oct 11, 2023
8b86648
Updated references to Unity Inference Engine to Sentis. (#5998)
miguelalonsojr Oct 15, 2023
a6cf25a
Updated mkdocs.yml (#5957)
Siddhu2502 Oct 29, 2023
643df35
Fix mkdocs (#6003)
miguelalonsojr Oct 29, 2023
98338f2
Added no graphics monitor feature. (#6014)
miguelalonsojr Nov 22, 2023
ffa2e81
Upgraded to pytorch 2.1.1, fixed some windows related test issues. Up…
miguelalonsojr Nov 25, 2023
209d258
Fixed broken link issues in roller ball tutorial doc. (#6024)
miguelalonsojr Nov 26, 2023
ee80a7f
Fix tensor disposal (#6028)
miguelalonsojr Nov 30, 2023
b14c400
Added new 3DBall sample package. (#6030)
miguelalonsojr Dec 2, 2023
f442194
Fix yamato bokken images and perf tests (#6032)
miguelalonsojr Dec 2, 2023
86a3a6e
Fix pre-commit action failures: switch to ruby/setup-ruby (#6063)
alex-mccarthy-unity Mar 4, 2024
3fc8d8e
Update links to PettingZoo homepage (#6065)
alex-mccarthy-unity Mar 6, 2024
e322b61
Fix nightly test runs (#6069)
alex-mccarthy-unity Mar 6, 2024
66f6b34
Document grpcio installation for OS X (#6067)
alex-mccarthy-unity Mar 6, 2024
6004556
Upgrade ONNX to 1.15.0 (#6062)
alex-mccarthy-unity Mar 6, 2024
1bee58f
Fix cuda not being used on windows: update pytorch version (#6064)
alex-mccarthy-unity Mar 6, 2024
4f2cfd1
Fix documentation typos and list rendering (#6066)
alex-mccarthy-unity Mar 6, 2024
f6486fc
Deprecated actions (#6077)
alex-mccarthy-unity Mar 9, 2024
b9ac3f1
Fix dead links to Tensorboard (#6075)
alex-mccarthy-unity Mar 9, 2024
92cbaad
Fix GPU continuous build: correct torch version, and remove torchaudi…
alex-mccarthy-unity Mar 9, 2024
10887de
Upgrade to Unity 2023.2 (#6071)
alex-mccarthy-unity Mar 9, 2024
b51eecf
Update to Sentis 1.3.0-pre.3 release (#6070)
alex-mccarthy-unity Mar 9, 2024
d9d5e0f
Update Using-Virtual-Environment.md (#6033)
alhasacademy96 Mar 11, 2024
ed807e3
Update Installation.md (#6004)
xyz2022 Mar 11, 2024
c4dc0a2
Fix bad link format introduced by #6033 (#6078)
alex-mccarthy-unity Mar 13, 2024
93221d4
Fix continuous integration tests across incompatible editor versions …
alex-mccarthy-unity Mar 13, 2024
b2a6b5b
Raise minimum numpy version to 1.23.5 to fix installation errors on w…
alex-mccarthy-unity Mar 14, 2024
692c910
Fix sample code indentation in migrating.md (#5840)
hamidrexa Mar 14, 2024
fb2af76
Use dotnet 8.x in pre-commits to fix flaky failures (#6083)
alex-mccarthy-unity Mar 14, 2024
dbb819b
Fixed missing assembly reference for google protobuf. (#6099)
miguelalonsojr Apr 19, 2024
d366798
Removed reference to GCP gym registry. (#6107)
miguelalonsojr May 2, 2024
a66ffbf
Restored reference to GCP gym registry. (#6108)
miguelalonsojr May 3, 2024
2b50f60
Develop upgrade Sentis 2.0.0 (#6137)
miguelalonsojr Aug 26, 2024
22a59aa
Fix failing ci post upgrade (#6141)
miguelalonsojr Sep 1, 2024
057e264
Release/3.0.0 (#6153)
miguelalonsojr Oct 3, 2024
36b312a
Bumped versions. (#6155)
miguelalonsojr Oct 5, 2024
8760552
Minor fix to validate versions util. (#6156)
miguelalonsojr Oct 5, 2024
ac576f9
Release 22 mm (#6157)
miguelalonsojr Oct 5, 2024
cfb26e3
fix(docs): remove --branch flag from git clone command for bleeding e…
louisgthier Oct 28, 2024
1ae454d
Update to Unity 6000.0 (#6207)
alexander-suvorov Jun 13, 2025
39f4e42
Upgrade grpcio version (#6208)
maryamziaa Jun 13, 2025
b6abc45
Update to Inference Engine 2.2.1 (#6212)
alexander-suvorov Jun 16, 2025
8034047
Update Analytics to use new API (#6221)
maryamziaa Jul 23, 2025
a9e40fc
Merge com.unity.ml-agents.extensions into com.unity.ml-agents (#6227)
maryamziaa Jul 30, 2025
b909681
Remove broken Sample from the package (#6230)
maryamziaa Aug 1, 2025
bca9a40
A new training mode called "both" has been added. This allows simulta…
VictorBarbosa Aug 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Please wrap in triple backticks (```) to make it easier to read.
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- Unity Version: [e.g. Unity 2022.3f1]
- Unity Version: [e.g. Unity 6000.0.40f1]
- OS + version: [e.g. Windows 10]
- _ML-Agents version_: (e.g. ML-Agents v0.8, or latest `develop` branch from source)
- _Torch version_: (you can run `pip3 show torch` to get this)
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/colab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
colab:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
COLAB_ALWAYS_INSTALL_XVFB: 1
QLEARNING_NUM_TRAINING_STEPS: 5
Expand All @@ -27,16 +27,16 @@ jobs:
matrix:
notebook_path: [Colab_UnityEnvironment_1_Run.ipynb, Colab_UnityEnvironment_2_Train.ipynb, Colab_UnityEnvironment_3_SideChannel.ipynb]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10.12
- uses: actions/setup-dotnet@v1
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand All @@ -56,9 +56,9 @@ jobs:
- name: Execute notebook
run: jupyter nbconvert --to notebook --execute --log-level=DEBUG --ExecutePreprocessor.kernel_name=python3 --output output-${{ matrix.notebook_path }} colab/${{ matrix.notebook_path }}
- name: Upload colab results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: artifacts
name: artifacts-${{ matrix.notebook_path }}
path: |
colab/output-${{ matrix.notebook_path }}
# Use always() to always run this step to publish execution results when there are failures
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
- uses: actions/stale@v9
with:
days-before-issue-stale: 30
days-before-issue-close: 14
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ jobs:
markdown-link-check-full:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.12
- uses: actions/setup-node@v4
with:
node-version: '12'
- name: Install manual dependencies
Expand All @@ -26,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
# TODO: Re-use pytest workflow once https://github.com/github/roadmap/issues/257 is done.
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - uses: ./.github/workflows/pytest.yml
# with:
# # Run all tests.
Expand All @@ -37,18 +39,18 @@ jobs:
# If one test in the matrix fails we still want to run the others.
fail-fast: false
matrix:
python-version: [3.10.x]
python-version: [3.10.12]
include:
- python-version: 3.10.x
- python-version: 3.10.12
pip_constraints: test_constraints_version.txt
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:
--cov-report=html --junitxml=junit/test-results-${{ matrix.python-version }}.xml \
-p no:warnings -v -n 8
- name: Upload pytest test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.python-version }}
path: |
Expand Down
35 changes: 22 additions & 13 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@ on:

jobs:
pre-commit:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
DOTNET_NOLOGO: 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.x
- uses: actions/setup-ruby@v1
- uses: ruby/setup-ruby@v1
env:
ImageOS: ubuntu20
ImageOS: ubuntu24
with:
ruby-version: '2.6'
- uses: actions/setup-dotnet@v3
ruby-version: '2.7'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.100'
dotnet-version: '8.0.202'
- name: Clean dotnet shared memory
run: sudo rm -rf /tmp/.dotnet/shm
- name: Install manual dependencies
run: |
python -m pip install pre-commit
Expand All @@ -35,9 +40,11 @@ jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.x
- uses: actions/setup-node@v4
with:
node-version: '12'
- name: Install manual dependencies
Expand All @@ -52,6 +59,8 @@ jobs:
validate-meta-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.x
- run: python utils/validate_meta_files.py
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
token: ${{ secrets.PUBLIC_GH_TOKEN }}
- name: Setup Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10
- name: Publish docs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: 3.10.x
- name: Install dependencies
run: pip install setuptools wheel twine --user
- name: verify git tag vs. version
Expand All @@ -35,14 +35,14 @@ jobs:
python setup.py bdist_wheel
- name: Publish distribution 📦 to Test PyPI
if: startsWith(github.ref, 'refs/tags') && contains(github.ref, 'test')
uses: actions/gh-action-pypi-publish@717ba43cfbb0387f6ce311b169a825772f54d295
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
packages_dir: ${{ matrix.package-path }}/dist/
- name: Publish distribution 📦 to Production PyPI
if: startsWith(github.ref, 'refs/tags') && !contains(github.ref, 'test')
uses: actions/gh-action-pypi-publish@717ba43cfbb0387f6ce311b169a825772f54d295
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: ${{ matrix.package-path }}/dist/
6 changes: 3 additions & 3 deletions .github/workflows/publish_pypi_python_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
package-path: [ml-agents-envs]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: 3.10.x
- name: Install dependencies
run: pip install setuptools wheel twine --user
- name: verify git tag vs. version
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
- python-version: 3.10.12
pip_constraints: test_constraints_version.txt
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand All @@ -75,17 +75,17 @@ jobs:
id: pytest_marker
run: |
if [ "${{ github.event.inputs.pytest_markers }}" != "" ]; then
echo "::set-output name=markers::${{ github.event.inputs.pytest_markers }}"
echo "markers=${{ github.event.inputs.pytest_markers }}" >> $GITHUB_OUTPUT
else
echo "::set-output name=markers::not slow"
echo "markers=not slow" >> $GITHUB_OUTPUT
fi
- name: Run pytest
run: |
pytest --cov=ml-agents --cov=ml-agents-envs \
--cov-report=html --junitxml=junit/test-results-${{ matrix.python-version }}.xml \
-p no:warnings -v -m "${{ steps.pytest_marker.outputs.markers }}" -n 8
- name: Upload pytest test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.python-version }}
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate_catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: [ubuntu-latest]
steps:
- id: 'Checkout'
uses: actions/checkout@v2
uses: actions/checkout@v4

- id: 'Validate'
uses: 'RoadieHQ/backstage-entity-validator@v0.3.2'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ coverage.xml
/htmlcov/

**/UserSettings/*

# yamato-parser temporary output files:
.yamato/unfolded/
9 changes: 3 additions & 6 deletions .yamato/com.unity.ml-agents-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
{% for platform in coverage_test_platforms %}
{% capture coverageOptions %} --enable-code-coverage --code-coverage-options 'generateHtmlReport;assemblyFilters:+{{ package.assembly }}'{% endcapture %}

test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
name : Coverage {{ package.name }} test {{ editor.version }} on {{ platform.name }}
test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}_{{ editor.testProject }}:
name : Coverage {{ package.name }} test {{ editor.version }} on {{ platform.name }} in {{ editor.testProject }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@1.27.0 -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ editor.version }} --type project-tests --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
- |
conda activate python3.10
Expand All @@ -33,9 +33,6 @@ test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
NOT pull_request.draft AND
(pull_request.changes.any match "com.unity.ml-agents/**" OR
pull_request.changes.any match " {{ editor.testProject }}/**" OR
{% if package.name == "com.unity.ml-agents.extensions" %}
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
{% endif %}
pull_request.changes.any match ".yamato/com.unity.ml-agents-coverage.yml")
{% endif %}
{% endfor %}
Expand Down
8 changes: 5 additions & 3 deletions .yamato/com.unity.ml-agents-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ pack:
name: Pack
agent:
type: Unity::VM
image: ml-agents/ml-agents-ubuntu-18.04:latest
flavor: b1.small
image: ml-agents/ubuntu-ci:v1.0.0
flavor: b1.medium
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
sudo apt-get update
sudo apt-get install upm-pvp=0.76.0
conda activate python3.10
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u 2022.3 -c editor --wait --fast
unity-downloader-cli -u 6000.0 -c editor --wait --fast
./.Editor/Unity -projectPath Project -batchMode -executeMethod Unity.MLAgents.SampleExporter.ExportCuratedSamples -logFile -
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
upm-ci project pack --project-path Project
Expand Down
60 changes: 30 additions & 30 deletions .yamato/com.unity.ml-agents-performance.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
test_editors:
- version: 2022.3
- version: 2023.1
---
{% for editor in test_editors %}
Run_Mac_Perfomance_Tests{{ editor.version }}:
name: Run Mac Performance Tests {{ editor.version }}
agent:
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: b1.small
variables:
UNITY_VERSION: {{ editor.version }}
commands:
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
- chmod +x ./utr
- ./utr --suite=editor --platform=StandaloneOSX --editor-location=.Editor --testproject=DevProject --artifacts_path=build/test-results --report-performance-data --performance-project-id=com.unity.ml-agents --zero-tests-are-ok=1
triggers:
cancel_old_ci: true
recurring:
- branch: develop
frequency: daily
artifacts:
logs:
paths:
- "build/test-results/**"
- "*.log"
{% endfor %}
#disabling mac perf tests until utr issue is resolved.
#test_editors:
# - version: 2023.2
#---
#{% for editor in test_editors %}
#Run_Mac_Perfomance_Tests{{ editor.version }}:
# name: Run Mac Performance Tests {{ editor.version }}
# agent:
# type: Unity::VM::osx
# image: package-ci/macos-13:v4
# flavor: b1.large
# variables:
# UNITY_VERSION: {{ editor.version }}
# commands:
# - python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
# - unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
# - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
# - chmod +x ./utr
# - ./utr --suite=editor --platform=StandaloneOSX --editor-location=.Editor --testproject=PerformanceProject --artifacts_path=build/test-results --report-performance-data --performance-project-id=com.unity.ml-agents --zero-tests-are-ok=1
# triggers:
# cancel_old_ci: true
# recurring:
# - branch: develop
# frequency: daily
# artifacts:
# logs:
# paths:
# - "build/test-results/**"
# - "*.log"
#{% endfor %}
Loading