Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NeoML] Layers mem-optimize #1118

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

favorart
Copy link
Contributor

@favorart favorart commented Sep 11, 2024

The max consumption of temporary memory is reduced by layers:

  • CBatchNormalizationLayer.runWhenLearning()

    • from objectSize + inputSize to max( inputSize, objectSize )
    • tested
  • CBatchNormalizationLayer.backwardWhenLearning()

    • from outputDiffSize +3* objectSize to outputDiffSize +1* objectSize
    • tested
  • CBinaryCrossEntropyLayer.BatchCalculateLossAndGradient()

    • from 9 to 3 (* batchSize)
    • tested
  • CCenterLossLayer.BatchCalculateLossAndGradient()

    • from 3 to 2 (* inputDataSize) and 3 to 2 * (classCentersSize)
    • tested
  • CFocalLossLayer.BatchCalculateLossAndGradient()

    • from (dataSize +3* batchSize) to (max( dataSize, batchSize ) + batchSize)
    • tested
  • CGELULayer.backwardFastApproximate()

    • from 2 to 1 (* dataSize)
    • tested
  • CPrecisionRecallLayer .RunOnceAfterReset()

    • from 8 to 3 (* vectorSize)
    • tested

@favorart favorart added the performance Changes of performance improvements only label Sep 11, 2024
@favorart favorart force-pushed the golikovLayersMemory branch 9 times, most recently from 76d935f to 0b930cd Compare September 18, 2024 20:12
@favorart favorart force-pushed the golikovLayersMemory branch 4 times, most recently from 444e4f3 to 8a79d04 Compare September 23, 2024 16:45
Signed-off-by: Kirill Golikov <[email protected]>
Signed-off-by: Kirill Golikov <[email protected]>
Signed-off-by: Kirill Golikov <[email protected]>
Signed-off-by: Kirill Golikov <[email protected]>
Signed-off-by: Kirill Golikov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Changes of performance improvements only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant