MCPcopy
hub / github.com/InternLM/lmdeploy / values

Method values

lmdeploy/pytorch/engine/model_agent/dp_utils.py:65–82  ·  view source on GitHub ↗

Serialize local metadata for scalar all-gather.

(self, *, is_spec_enabled: bool, is_microbatch_enabled: bool)

Source from the content-addressed store, hash-verified

63 return field_names
64
65 def values(self, *, is_spec_enabled: bool, is_microbatch_enabled: bool) -> list[int]:
66 """Serialize local metadata for scalar all-gather."""
67 raw_values = {
68 'is_decoding': int(self.is_decoding),
69 'is_dummy': int(self.is_dummy),
70 'num_tokens': self.num_tokens,
71 'is_sleeping': int(self.is_sleeping),
72 'batch_size': self.batch_size,
73 'draft_num_tokens': self.draft_num_tokens if self.draft_num_tokens is not None else self.num_tokens,
74 'enable_microbatch': int(self.enable_microbatch or False),
75 }
76 return [
77 raw_values[name]
78 for name in self.field_names(
79 is_spec_enabled=is_spec_enabled,
80 is_microbatch_enabled=is_microbatch_enabled,
81 )
82 ]
83
84
85@dataclass

Callers 15

_prepare_dp_v1Method · 0.95
wrapperFunction · 0.80
_gather_shardsFunction · 0.80
from_huggingfaceMethod · 0.80
async_abort_allMethod · 0.80
stream_responseFunction · 0.80
_wrap_decoder_layersMethod · 0.80
__enter__Method · 0.80
__exit__Method · 0.80
__enter__Method · 0.80

Calls 1

field_namesMethod · 0.95