MCPcopy Create free account
hub / github.com/RL-Align/RL-Kernel / _enough_gpu_memory

Function _enough_gpu_memory

tests/test_embedding.py:169–173  ·  view source on GitHub ↗
(num_bytes: int)

Source from the content-addressed store, hash-verified

167# logic; this one validates the real index range (incl. boundary ids 0 and
168# vocab-1) and the real hidden width, with a small (batch, seq) load point.
169def _enough_gpu_memory(num_bytes: int) -> bool:
170 if not torch.cuda.is_available():
171 return False
172 free, _ = torch.cuda.mem_get_info()
173 return free > int(num_bytes * 1.5) # headroom for the gathered output
174
175
176@pytest.mark.skipif(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected