CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-lightning

The Deep Learning framework to train, deploy, and ship AI products Lightning fast.

Pending
Overview
Eval results
Files

profilers.mddocs/

Profiling and Performance Analysis

Profiling tools for analyzing training performance, identifying bottlenecks, and optimizing model training efficiency across different hardware configurations.

Capabilities

PyTorch Profiler

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."""

Advanced 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."""

Simple 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."""

Pass Through Profiler

No-operation profiler that disables profiling without code changes.

class PassThroughProfiler:
    def __init__(self):
        """Initialize pass-through profiler that performs no profiling."""

XLA Profiler

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 Profiler

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

docs

accelerators.md

callbacks.md

core-training.md

data.md

fabric.md

index.md

loggers.md

precision.md

profilers.md

strategies.md

tile.json