The Deep Learning framework to train, deploy, and ship AI products Lightning fast.
—
Profiling tools for analyzing training performance, identifying bottlenecks, and optimizing model training efficiency across different hardware configurations.
Integration with PyTorch's built-in profiler for detailed performance analysis.
class PyTorchProfiler:
def __init__(
self,
dirpath: Optional[str] = None,
filename: Optional[str] = None,
group_by_input_shapes: bool = False,
emit_nvtx: bool = False,
export_to_chrome: bool = True,
row_limit: int = 20,
sort_by_key: Optional[str] = None,
record_functions: Set[str] = None,
record_shapes: bool = False,
profile_memory: bool = False,
with_stack: bool = False,
with_flops: bool = False,
with_modules: bool = False,
**profiler_kwargs
):
"""Initialize PyTorch profiler."""Comprehensive profiling with detailed timing information.
class AdvancedProfiler:
def __init__(
self,
dirpath: Optional[str] = None,
filename: Optional[str] = None,
line_count_restriction: float = 1.0
):
"""Initialize advanced profiler."""Basic profiling for quick performance analysis.
class SimpleProfiler:
def __init__(
self,
dirpath: Optional[str] = None,
filename: Optional[str] = None,
extended: bool = True
):
"""Initialize simple profiler."""No-operation profiler that disables profiling without code changes.
class PassThroughProfiler:
def __init__(self):
"""Initialize pass-through profiler that performs no profiling."""Profiler for TPU training with XLA optimization analysis.
class XLAProfiler:
def __init__(
self,
port: int = 9012,
record_shapes: bool = False,
profile_memory: bool = False
):
"""Initialize XLA profiler for TPU performance analysis."""Base class for implementing custom profilers.
class Profiler:
def __init__(self):
"""Initialize base profiler."""
def start(self, action_name: str) -> None:
"""Start profiling an action."""
def stop(self, action_name: str) -> None:
"""Stop profiling an action."""
def summary(self) -> str:
"""Get profiling summary."""
def describe(self) -> None:
"""Print profiling description."""Install with Tessl CLI
npx tessl i tessl/pypi-lightning