rlscope.profiler package¶
Submodules¶
rlscope.profiler.clib_wrap module¶
rlscope.profiler.concurrent module¶
rlscope.profiler.cudaprofile module¶
rlscope.profiler.estimator module¶
rlscope.profiler.experiment module¶
rlscope.profiler.glbl module¶
rlscope.profiler.log_stacktrace module¶
Code for recording and logging stack traces of training scripts to help determine how Python interfaces with native C libraries.
This code was useful for determining how Python calls into PyTorch; PyTorch has multiple native shared libraries it calls into.
-
rlscope.profiler.log_stacktrace.
with_log_stacktraces
()[source]¶ Context manager for soft device placement, allowing summaries on CPU.
Eager and graph contexts have different default device placements. See b/148408921 for details. This context manager should be used whenever using summary writers contexts to make sure summaries work when executing on TPUs.
- Yields:
Sets tf.config.set_soft_device_placement(True) within the context
rlscope.profiler.nvidia_gpu_query module¶
rlscope.profiler.profilers module¶
rlscope.profiler.proto_util module¶
rlscope.profiler.rlscope_logging module¶
RL-Scope log message configuration.
RL-Scope uses different colours to mark different log messages:
INFO: green
WARNING: yellow
ERROR: red
DEBUG: white
DEBUG messages are enabled by default, and must be disabled using
rlscope.profiler.rlscope_logging.disable_debug_logging()
.
Examples
>>> from rlscope.profiler.rlscope_logging import logger
... from rlscope.profiler import rlscope_logging
...
... # e.g., print a informational message in green
... logger.info("This info message is seen")
...
... # e.g., disable rlscope debug messages
... rlscope_logging.disable_debug_logging()
... logger.debug("This debug message is NOT seen")
...
... # e.g., print an error message in red
... logger.error("This is an error")
-
rlscope.profiler.rlscope_logging.
logger
¶ Singleton Logger object used throughout rlscope module for logging coloured info/debug/errors messages with line numbers.
- Type
logging.Logger
rlscope.profiler.session module¶
rlscope.profiler.timer module¶
Get the current timestamp with microsecond resolution.
rlscope.profiler.unit_test_util module¶
rlscope.profiler.util module¶
rlscope.profiler.wrap_util module¶
Functions for iterating over symbols in Python native library objects, and wrapping/unwrapping them with a callable class.
See also
rlscope.clib_wrap.CFuncWrapper
callable wrapper class around native functions for recording start/end timestamps.
rlscope.clib_wrap
uses wrap_util functions to wrap TensorFlow, PyTorch, and simulator native libraries.