(num_bytes: int)
| 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. |
| 169 | def _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( |
nothing calls this directly
no outgoing calls
no test coverage detected