Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Match 3 Agent GC bug

Discussion in 'ML-Agents' started by STKMAN, Apr 6, 2021.

  1. STKMAN

    STKMAN

    Joined:
    Mar 10, 2016
    Posts:
    7


    My project is Match3 , if I don't use ML, my CPU main is 10ms, but if the ML start working it's going to 1600ms.

    And I found the more cell types the more GC, code like this
    upload_2021-4-6_17-43-48.png
     
  2. celion_unity

    celion_unity

    Unity Technologies

    Joined:
    Jun 12, 2019
    Posts:
    269
    Hi,
    The observation size for the Match3 sensors is roughly (Rows * Columns * (NumCellTypes + NumSpecialTypes)), so it's not too surprising that increasing those will increase the memory usage.

    Some of the GC churn during training is hard to avoid because we have to use protobuf objects to pass information to the trainer. But there's definitely some allocations that we can reuse in training, especially here (which only happens if you're using visual observations with compression). I'll do a pass on this today and try to clean up any allocations that I can.
     
  3. celion_unity

    celion_unity

    Unity Technologies

    Joined:
    Jun 12, 2019
    Posts:
    269
unityunity