メインコンテンツまでスキップ
バージョン: v2509

tuners.command_executor

CommandExecutor Objects

class CommandExecutor()

Command execution functionality with auto pruner support.

__init__

def __init__(auto_pruners: Optional[List[AutoPrunerBase]] = None,
poll_interval: float = 0.1,
dist_info: Optional[Dict[str, Union[int, str]]] = None)

Initialize the CommandExecutor.

Arguments:

  • auto_pruners - List of auto pruners to monitor during execution
  • poll_interval - Polling interval in seconds. Defaults to 0.1
  • dist_info - Distribution information for rank checking. If None, will be obtained automatically.

run

def run(command: str, log_path: Optional[str] = None) -> bool

Run a command with optional logging and polling.

Arguments:

  • command str - The command to execute.
  • log_path Optional[str] - The log file path. If provided, enables logging.

Returns:

  • bool - True if command completed successfully, False if timed out, pruned, or failed.