MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / MemoryBufferModuleWrapper

Class MemoryBufferModuleWrapper

verl/verl/utils/memory_buffer.py:143–160  ·  view source on GitHub ↗

Note that we do not design MemoryBufferModuleWrapper as an nn.Module due to - It will change the checkpoint name

Source from the content-addressed store, hash-verified

141
142
143class MemoryBufferModuleWrapper:
144 """
145 Note that we do not design MemoryBufferModuleWrapper as an nn.Module due to
146 - It will change the checkpoint name
147 """
148
149 def __init__(self, module: nn.Module):
150 super().__init__()
151 self.module = module
152 self.weight_buffer_meta = get_weight_buffer_meta_from_module(self.module)
153 self.memory_buffers = build_memory_buffer(self.weight_buffer_meta)
154 build_memory_reference_from_module(self.module, self.memory_buffers)
155
156 def get_memory_buffers(self):
157 return self.memory_buffers
158
159 def get_weight_buffer_meta(self):
160 return self.weight_buffer_meta
161
162
163class MegatronMemoryBufferForRollout(object):

Callers 1

test_memory_buffersFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_memory_buffersFunction · 0.72