MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / allocate_mem_buff

Function allocate_mem_buff

DeepSpeedExample/megatron/memory.py:24–29  ·  view source on GitHub ↗

Allocate a memory buffer.

(name, numel, dtype, track_usage)

Source from the content-addressed store, hash-verified

22
23
24def allocate_mem_buff(name, numel, dtype, track_usage):
25 """Allocate a memory buffer."""
26 assert name not in _MEM_BUFFS, \
27 'memory buffer {} already allocated.'.format(name)
28 _MEM_BUFFS[name] = MemoryBuffer(name, numel, dtype, track_usage)
29 return _MEM_BUFFS[name]
30
31
32def get_mem_buff(name):

Calls 1

MemoryBufferClass · 0.85

Tested by

no test coverage detected