Skip to content

vllm.v1.worker.ubatch_utils

Classes:

Functions:

SMControlContextManager

Methods:

  • __init__ –

    Context manager for controlling SM (Streaming Multiprocessor)

__init__(comm_sms, set_comm_sms, set_compute_sms)

Context manager for controlling SM (Streaming Multiprocessor) allocation. Upon entering the context, it sets the number of SMs allocated for communication and computation to comm_sms and total_sms - comm_sms respectively. Upon exiting, it restores the allocation to use all available SMs (i.e. total_sms).

Parameters:

  • comm_sms

    (int) –

    The number of SMs to allocate for communication. (The remainder will be used for computation.)

  • set_comm_sms

    (Callable[[int], None]) –

    A function that sets the number of SMs for communication.

  • set_compute_sms

    (Callable[[int], None]) –

    A function that sets the number of SMs for computation.

create_sm_control_context(parallel_config)

Reserve SMs for communication kernels while microbatches overlap.

get_num_ubatches(parallel_config)

How many microbatches a step is split into; 1 when microbatching is off.