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
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.
The improvements to this are in https://github.com/Unity-Technologies/ml-agents/pull/5233 and will be in the next release (in about 2 weeks).
Great, the new version came out on Tuesday. Note that the Match3 code is now part of com.unity.ml-agents (not the extensions package), and also the AbstractBoard class changed a bit.