vllm.v1.worker.ubatch_utils
¶
Classes:
Functions:
-
create_sm_control_context–Reserve SMs for communication kernels while microbatches overlap.
-
get_num_ubatches–How many microbatches a step is split into; 1 when microbatching is off.
SMControlContextManager
¶
Methods:
-
__init__–Context manager for controlling SM (Streaming Multiprocessor)
Source code in vllm/v1/worker/ubatch_utils.py
__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.
Source code in vllm/v1/worker/ubatch_utils.py
create_sm_control_context(parallel_config)
¶
Reserve SMs for communication kernels while microbatches overlap.
Source code in vllm/v1/worker/ubatch_utils.py
get_num_ubatches(parallel_config)
¶
How many microbatches a step is split into; 1 when microbatching is off.