fulqrum.gpu.configure_gpu_logging

configure_gpu_logging(mode='summary', *, stream=None, rank=0, ranks='primary', formatter=None)[source]

Configure GPU log output and return the installed stream handler.

Modes control which records this handler displays:

  • quiet: warnings and errors only.

  • summary: INFO messages, warnings and errors.

  • detailed: also normal DEBUG messages.

  • trace: also records from fulqrum.gpu.diagnostics.

Warning and error records bypass rank filtering in every mode. Timing and debug configuration flags are unchanged.

Reconfiguration replaces handlers previously installed by this function. Caller-owned handlers remain attached. The fulqrum.gpu logger’s level is updated and propagation to parent loggers is disabled; root logger settings remain unchanged.

Parameters:
  • mode – quiet, summary (default), detailed or trace.

  • stream – Text stream for output; defaults to stderr.

  • rank – Fallback rank ID for filtering records without gpu_rank metadata; defaults to 0. For MPI, pass this process’s communicator rank.

  • ranks – Routine-output filter: "primary" selects rank 0 (default), "all" selects every rank, or supply an iterable of rank IDs.

  • formatter – Optional logging.Formatter. The default prints only the message, without timestamps or level prefixes.

Returns:

The new logging.StreamHandler attached to fulqrum.gpu.

Raises:

ValueError – The mode, rank or rank selection is invalid.