Skip to content

Changed the way that the memory for the activations is calculated#6

Open
krvas wants to merge 2 commits intomanuelescobar-dev:mainfrom
krvas:fix-activation-calculation
Open

Changed the way that the memory for the activations is calculated#6
krvas wants to merge 2 commits intomanuelescobar-dev:mainfrom
krvas:fix-activation-calculation

Conversation

@krvas
Copy link
Copy Markdown

@krvas krvas commented Oct 21, 2025

Hi,

I noticed that you had pulled a formula for calculating the amount of memory required from this paper. However, the paper makes certain assumptions about what precision floats we are using for the model, and on that basis it comes up with the formula. The code here is made to work with any kind of precision, so I made some edits that make the same formula from the paper more generalised. Hope this helps!

I also realised that KV cache memory is being calculated for training. However, KV caching is only done during inference, so I have removed that from the memory calculation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant