Skip to content
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

Control number of episodes in ULTRA tests (rllib and train) #739

Merged
merged 23 commits into from Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a652156
Make evaluations run in parallel to training
christianjans Mar 17, 2021
188bd0e
Update ULTRA tests by merging branch 'develop'
christianjans Mar 31, 2021
6a292ea
Add rollout_fragment_length and max_episode_steps to rllib
AlexLewandowski Apr 5, 2021
3a8f342
Add new flags to documentation
AlexLewandowski Apr 5, 2021
07bd942
Fix flag in example
AlexLewandowski Apr 5, 2021
b2392a6
Ensure evaluation is not run in test_train.py
AlexLewandowski Apr 6, 2021
264c74d
Check if log_dir doesn't exist in test_train.py
AlexLewandowski Apr 6, 2021
bf2c37c
Fix typo in argument and set eval_episodes to 0
AlexLewandowski Apr 6, 2021
84036cb
Check if not exists for paths
AlexLewandowski Apr 6, 2021
96d806f
Fix formatting
AlexLewandowski Apr 6, 2021
a55c732
Update evaluate and train to evaluate per episode (#639)
AlexLewandowski Apr 6, 2021
5d00198
Merge with ultra-rllib-speedup-tests
AlexLewandowski Apr 6, 2021
9c4e572
Merge branch 'ultra_parallel_evaluation' into ultra-speedup-rllib-tests
AlexLewandowski Apr 6, 2021
905b510
Rename evaluation_task_id for training
AlexLewandowski Apr 6, 2021
c224863
Simplify argument to ray.wait(...)
christianjans Apr 6, 2021
1b3e22f
Remove print statements
AlexLewandowski Apr 7, 2021
3b19843
Fix defaults
AlexLewandowski Apr 7, 2021
8c1e105
Fix eval-rate in docs
AlexLewandowski Apr 7, 2021
bb558a2
Merge branch 'ultra-develop' into ultra-speedup-rllib-tests
AlexLewandowski Apr 7, 2021
c144978
Initial changes (#744)
christianjans Apr 13, 2021
1797a9f
Merge branch 'ultra-develop' into ultra-speedup-rllib-tests
AlexLewandowski Apr 14, 2021
5591057
Merge branch 'ultra-speedup-rllib-tests' of github.com:huawei-noah/SM…
AlexLewandowski Apr 14, 2021
958b9c0
Merge branch 'ultra-develop' into ultra-speedup-rllib-tests
AlexLewandowski Apr 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 54 additions & 6 deletions .github/workflows/ci-ultra-tests.yml
Expand Up @@ -3,7 +3,7 @@ name: ULTRA CI Base Tests
on: [push, pull_request]

jobs:
test-base:
test-heavy-base-tests:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
container: huaweinoah/smarts:v0.4.13-minimal
Expand All @@ -28,12 +28,58 @@ jobs:
pip install --upgrade --upgrade-strategy eager wheel
pip install --upgrade -e .
pip install --upgrade numpy
- name: Run ultra tests
- name: Run ultra tests (heavy)
run: |
cd ultra
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v ./tests/
pytest -v \
./tests/ \
--ignore=./tests/test_ultra_package.py \
--ignore=./tests/test_adapter.py \
--ignore=./tests/test_env.py \
--ignore=./tests/test_episodes.py \
--ignore=./tests/test_scenarios.py \
--ignore=./tests/test_social_vehicles.py \
--ignore=./tests/test_rllib_train.py \

test-light-base-tests:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
container: huaweinoah/smarts:v0.4.13-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup X11
run: |
/usr/bin/Xorg \
-noreset \
+extension GLX \
+extension RANDR \
+extension RENDER \
-logfile ./xdummy.log \
-config /etc/X11/xorg.conf :1 &
- name: Install dependencies
run: |
cd ultra
python3.7 -m venv .venv
. .venv/bin/activate
pip install --upgrade --upgrade-strategy eager pip
pip install --upgrade --upgrade-strategy eager wheel
pip install --upgrade -e .
pip install --upgrade numpy
- name: Run ultra tests (light)
run: |
cd ultra
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v \
./tests/ \
--ignore=./tests/test_ultra_package.py \
--ignore=./tests/test_train.py \
--ignore=./tests/test_evaluate.py \
--ignore=./tests/test_analysis.py \

test-package-via-setup:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand Down Expand Up @@ -64,6 +110,7 @@ jobs:
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v ./tests/test_ultra_package.py

test-package-via-wheel:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand All @@ -85,9 +132,9 @@ jobs:
cd ultra
python3.7 -m venv .venv
. .venv/bin/activate
pip install --upgrade --upgrade-strategy eager pip
pip install --upgrade --upgrade-strategy eager wheel
pip install --upgrade --upgrade-strategy eager -e .
pip install --upgrade pip
pip install --upgrade -e .
pip install --upgrade numpy
python setup.py bdist_wheel
cd dist
pip install $(ls . | grep ultra)
Expand All @@ -99,6 +146,7 @@ jobs:
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v ./tests/test_ultra_package.py

# test-package-via-pypi:
# runs-on: ubuntu-18.04
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
### Added
- Added `sanity-test` script and asked new users to run `sanity-test` instead of `make test` to ease the setup
process
- Added `on_shoulder` as part of events in observation returned from each step of simulation

## [0.4.15] - 2021-03-18
### Added
Expand All @@ -38,6 +39,7 @@ using the original coordinate system. See Issue #325.
- Envision now resumes from current frame after un-pausing.
- Skipped generation of cut-in waypoints if they are further off-road than SMARTS currently supports to avoid process crash.
- Fix envision error 15 by cleanly shutting down the envision worker process.
- Refactored SMARTS class to not inherit from Panda3D's ShowBase; it's aggregated instead. See issue #597.

## [Format] - 2021-03-12
### Added
Expand Down
7 changes: 4 additions & 3 deletions smarts/core/events.py
Expand Up @@ -22,9 +22,10 @@

class Events(NamedTuple):
collisions: bool
off_route: bool
reached_goal: bool
reached_max_episode_steps: bool
off_road: bool
off_route: bool
on_shoulder: bool
wrong_way: bool
not_moving: bool
reached_goal: bool
reached_max_episode_steps: bool
4 changes: 2 additions & 2 deletions smarts/core/motion_planner_provider.py
Expand Up @@ -24,11 +24,11 @@
from .bezier_motion_planner import BezierMotionPlanner
from .controllers import ActionSpaceType
from .coordinates import Heading, Pose
from .provider import ProviderState
from .provider import Provider, ProviderState
from .vehicle import VEHICLE_CONFIGS, VehicleState


class MotionPlannerProvider:
class MotionPlannerProvider(Provider):
def __init__(self):
self._is_setup = False

Expand Down
30 changes: 29 additions & 1 deletion smarts/core/provider.py
Expand Up @@ -18,12 +18,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from dataclasses import dataclass, field
from typing import List
from typing import List, Set

import numpy as np

from .coordinates import BoundingBox, Pose
from .vehicle import VehicleState
from .scenario import Scenario
from .controllers import ActionSpaceType


@dataclass
Expand All @@ -46,3 +48,29 @@ def filter(self, vehicle_ids):
del self.vehicles[index]
except ValueError:
continue


class Provider:
"""A Provider tracks a (sub)set of vehicles that all share the same action space.
This is a base class (interface) from which all Providers should inherit."""

## TAI: Consider renaming to VehicleSet or somesuch.

@property
def action_spaces(self) -> Set[ActionSpaceType]:
raise NotImplementedError

def setup(self, scenario: Scenario) -> ProviderState:
raise NotImplementedError

def step(self, actions, dt, elapsed_sim_time) -> ProviderState:
raise NotImplementedError

def sync(self, provider_state: ProviderState):
raise NotImplementedError

def reset(self):
raise NotImplementedError

def teardown(self):
raise NotImplementedError