Skip to content

Commit 473da6b

Browse files
hughperkinsduburcqaYilingQiao
committed
[FEATURE] Add performance mode (Genesis-Embodied-AI#1330)
* add perofrmance mode * change how performance mode is applied * move back into args * add info about perofrmance mode * update comment --------- Co-authored-by: Alexis DUBURCQ <alexis.duburcq@gmail.com> Co-authored-by: YilingQiao <49262224+YilingQiao@users.noreply.github.com>
1 parent 17edb18 commit 473da6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

genesis/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def init(
5050
backend=None,
5151
theme="dark",
5252
logger_verbose_time=False,
53+
performance_mode: bool = False, # True: compilation up to 6x slower (GJK), but runs ~1-5% faster
5354
):
5455
# Consider Genesis as initialized right away
5556
global _initialized
@@ -172,6 +173,12 @@ def init(
172173
torch.backends.cudnn.benchmark = False
173174
logger.info("Beware running Genesis in debug mode dramatically reduces runtime speed.")
174175

176+
if not performance_mode:
177+
logger.info(
178+
"Consider setting 'performance_mode=True' in production to maximise runtime speed, if significantly "
179+
"increasing compilation time is not a concern."
180+
)
181+
175182
if seed is not None:
176183
global SEED
177184
SEED = seed
@@ -197,6 +204,7 @@ def init(
197204
force_scalarize_matrix=True,
198205
# Turning off 'advanced_optimization' is causing issues on MacOS
199206
advanced_optimization=True,
207+
cfg_optimization=performance_mode,
200208
fast_math=not debug,
201209
default_ip=ti_int,
202210
default_fp=ti_float,

0 commit comments

Comments
 (0)