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

[Development] Batch renderer integration #1200

Merged
merged 35 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f6bb80f
Add batch renderer configuration fields.
0mdc Feb 28, 2023
4e3c091
Set simulator configuration flags for batch rendering.
0mdc Feb 28, 2023
3745b59
Add BatchRenderVectorEnv.
0mdc Feb 28, 2023
acc09e7
Add BatchRenderVectorEnv creation.
0mdc Mar 1, 2023
59231ce
Add type annotations.
0mdc Mar 1, 2023
aa5680e
Add batch renderer class and load it.
0mdc Mar 1, 2023
48bfa22
Add render_state to sim observations when batch rendering.
0mdc Mar 1, 2023
74b4886
Add batch rendered vector env test.
0mdc Mar 8, 2023
07c355a
Add gpu-to-cpu batch rendering implementation.
0mdc Mar 11, 2023
03a6607
Make test_rl_batch_render_envs execute gpu-to-cpu only flow only.
0mdc Mar 12, 2023
d5e862d
Clean up batch renderer.
0mdc Mar 12, 2023
a068cd9
Code clean-up.
0mdc Mar 12, 2023
39ad565
Simplify transfer buffer.
0mdc Mar 14, 2023
c94a89d
Update docstrings.
0mdc Mar 14, 2023
ec9ef73
Create a file containing batch rendering constants. Move hardcoded st…
0mdc Mar 14, 2023
d89c87a
Formatting fix.
0mdc Mar 14, 2023
d04f809
Change render function name to match new habitat-sim api.
0mdc Mar 15, 2023
988e0a7
Rename render state to keyframe. Rename batch vector env render funct…
0mdc Mar 15, 2023
1770b4b
Assert config instead of automatically correcting it.
0mdc Mar 16, 2023
1177353
Remove BatchRendererVectorEnv. Directly use batch renderer from Vecto…
0mdc Mar 16, 2023
7bfa257
Format fix
0mdc Mar 16, 2023
0668add
Create batch renderer config. Move composite file specification in it.
0mdc Mar 16, 2023
1855dcd
Formatting fixes.
0mdc Mar 16, 2023
0d55286
Rename BatchRenderer to EnvBatchRenderer and BatchRendererConfig to R…
0mdc Mar 19, 2023
35ba958
Move enable_batch_renderer into RendererConfig.
0mdc Mar 19, 2023
5eb470d
Formatting fixes.
0mdc Mar 19, 2023
a0a3f0b
Fix composite file config path change.
0mdc Mar 19, 2023
1edfab5
Compare rgb image produced by reset in batch env test.
0mdc Mar 21, 2023
127466c
Add classic replay renderer option.
0mdc Mar 21, 2023
f7eb9b3
Add classic replay renderer test.
0mdc Mar 22, 2023
83b7b31
Review pass.
0mdc Mar 24, 2023
eaa205d
Change replayer renderer render call to match main.
0mdc Mar 27, 2023
eb042c7
Fix package import for new directory.
0mdc Mar 27, 2023
b08ee5e
Fix CI module import issue.
0mdc Apr 3, 2023
c06f18a
Change condition for assertion.
0mdc Apr 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ def construct_envs(
env_fn_args=tuple((c,) for c in configs),
workers_ignore_signals=workers_ignore_signals,
)

if config.habitat.simulator.renderer.enable_batch_renderer:
envs.initialize_batch_renderer(config)
0mdc marked this conversation as resolved.
Show resolved Hide resolved

return envs
16 changes: 16 additions & 0 deletions habitat-lab/habitat/config/default_structured_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,20 @@ class AgentConfig(HabitatBaseConfig):
motion_data_path: str = ""


@dataclass
class RendererConfig(HabitatBaseConfig):
r"""Configuration for the renderer.

:property enable_batch_renderer: [Experimental] Enables batch rendering, which accelerates rendering for concurrent environments. See env_batch_renderer.py for details.
:property composite_files: List of composite GLTF files to be pre-loaded by the batch renderer.
:property classic_replay_renderer: For debugging. Create a ClassicReplayRenderer instead of BatchReplayRenderer when enable_batch_renderer is active.
"""

enable_batch_renderer: bool = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the goal to have this be True at some point ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. However, we'll reach feature parity with the legacy renderer before doing so.

composite_files: Optional[List[str]] = None
classic_replay_renderer: bool = False


@dataclass
class HabitatSimV0Config(HabitatBaseConfig):
gpu_device_id: int = 0
Expand Down Expand Up @@ -1402,6 +1416,8 @@ class SimulatorConfig(HabitatBaseConfig):
ep_info: Optional[Any] = None
# The offset id values for the object
object_ids_start: int = 100
# Configuration for rendering
renderer: RendererConfig = RendererConfig()


@dataclass
Expand Down
5 changes: 5 additions & 0 deletions habitat-lab/habitat/core/batch_rendering/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python3

# Copyright (c) Meta Platforms, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Loading