Open GM-git-dotcom opened 1 month ago
Hi,
Love the repo for the self-explanatory code and fun comments!
I would appreciate it if you could explain how the next batch is asynchronously being fetched in train.py:
https://github.com/karpathy/nanoGPT/blob/325be85d9be8c81b436728a420e85796c57dba7e/train.py#L299-L305
At the outset, without explicitly using something like asyncio, the execution seemed sequential to me. Apologies for the potential triviality, thanks!
asyncio
It's due to this
x, y = x.pin_memory().to(device, non_blocking=True), y.pin_memory().to(device, non_blocking=True)
happens async
Hi,
Love the repo for the self-explanatory code and fun comments!
I would appreciate it if you could explain how the next batch is asynchronously being fetched in train.py:
https://github.com/karpathy/nanoGPT/blob/325be85d9be8c81b436728a420e85796c57dba7e/train.py#L299-L305
At the outset, without explicitly using something like
asyncio
, the execution seemed sequential to me. Apologies for the potential triviality, thanks!