mstar.engine.cuda_graph_config#
Functions
|
Split |
Classes
|
|
|
|
|
|
|
|
|
Equal-length batched capture: static input |
|
Everything a captured region is handed, at capture and at replay alike. |
|
One piecewise capture bucket. |
|
|
|
One inner callable of a submodule's forward, captured on its own. |
|
Packed variable-length capture: static input |
- class mstar.engine.cuda_graph_config.BatchedCudaGraphConfig(capture_graph_walk, single_request_inputs, replay_graph_walks=None, additional_key_info=None, compile=True, capture_batch_sizes=None, capture_forward_method='forward_batched', caps_eager_batch_size=True, total_tokens_multiplier=1)[source]#
Bases:
CudaGraphConfig- Parameters:
- class mstar.engine.cuda_graph_config.CudaGraphConfig(capture_graph_walk, replay_graph_walks=None, additional_key_info=None, compile=True, capture_batch_sizes=None, capture_forward_method='forward_batched', caps_eager_batch_size=True)[source]#
Bases:
ABC- Parameters:
- class mstar.engine.cuda_graph_config.CudaGraphConfigType(*values)[source]#
Bases:
Enum- BASIC_BATCHED = 'basic_batched'#
- FLASH_INFER_PACKED = 'flash_infer_packed'#
- class mstar.engine.cuda_graph_config.PackedCudaGraphConfig(capture_graph_walk, capture_token_lengths, make_node_input, replay_graph_walks=None, additional_key_info=None, compile=True, capture_batch_sizes=None, capture_forward_method='forward_batched', caps_eager_batch_size=True)[source]#
Bases:
CudaGraphConfig- Parameters:
- class mstar.engine.cuda_graph_config.PiecewiseBatchedConfig(*, capture_fn, make_static_inputs, declare_step=None, lease_before_step=False, forward_kwargs=<factory>, capture_batch_sizes=None, compile=False, seq_len)[source]#
Bases:
PiecewiseCudaGraphConfigEqual-length batched capture: static input
[bs, seq_len, D].- Parameters:
- get_capture_shapes(batch_sizes)[source]#
The (bs, seq_lens, total_tokens) buckets to capture.
batch_sizesis the resolved list the runner iterates (capture_batch_sizesor the runner default).- Parameters:
- Return type:
- class mstar.engine.cuda_graph_config.PiecewiseCallInputs(static_inputs, engine_inputs, kwargs=<factory>)[source]#
Bases:
objectEverything a captured region is handed, at capture and at replay alike.
Both calls go through here so a region can’t accidentally read something that only exists on one of the two paths.
- Parameters:
- engine_inputs: ModelInputsFromEngine#
- class mstar.engine.cuda_graph_config.PiecewiseCaptureShape(bs, seq_lens, total_tokens)[source]#
Bases:
objectOne piecewise capture bucket.
Handed to the static-input factory and the step declaration so both generalize across config types.
- class mstar.engine.cuda_graph_config.PiecewiseConfigType(*values)[source]#
Bases:
Enum- BATCHED = 'batched'#
- PACKED = 'packed'#
- class mstar.engine.cuda_graph_config.PiecewiseCudaGraphConfig(*, capture_fn, make_static_inputs, declare_step=None, lease_before_step=False, forward_kwargs=<factory>, capture_batch_sizes=None, compile=False)[source]#
Bases:
ABCOne inner callable of a submodule’s forward, captured on its own.
Unlike
CudaGraphConfig, which describes a wholeforward_batchedthe engine drives, this describes a SUB-REGION the submodule invokes itself while the surrounding preamble stays eager.kw_onlyso subclasses can add required fields (e.g.seq_len) without colliding with the defaulted ones here.- Parameters:
- abstractmethod get_capture_shapes(batch_sizes)[source]#
The (bs, seq_lens, total_tokens) buckets to capture.
batch_sizesis the resolved list the runner iterates (capture_batch_sizesor the runner default).- Parameters:
- Return type:
- class mstar.engine.cuda_graph_config.PiecewisePackedConfig(*, capture_fn, make_static_inputs, declare_step=None, lease_before_step=False, forward_kwargs=<factory>, capture_batch_sizes=None, compile=False, total_tokens)[source]#
Bases:
PiecewiseCudaGraphConfigPacked variable-length capture: static input
[total_tokens, D].One graph per (bs, token bucket). Each bucket is partitioned across
bsrequests for the capture-time plan; real per-request lengths arrive at replay.- Parameters:
- get_capture_shapes(batch_sizes)[source]#
The (bs, seq_lens, total_tokens) buckets to capture.
batch_sizesis the resolved list the runner iterates (capture_batch_sizesor the runner default).- Parameters:
- Return type: