- Home /
NN setup optimization
I (stupidly) used unity to make a complex neural network. The NN(Neural Network) Is entirly back end numbers and the only visuals are numbers on my screen in 2D that let me know how its going without any 3D features. Currently when its running my pc is at 12% CPU, 45% memory, 6% GPU, and my NN is at max 6fps I don't expect to ever get it over 20fps just hoping for better, but can't optomize the part of the code that causes the lag, Is is possible to give it more of my computer? I do not do anything else while its running so if other apps cannot run because 100% of the memory is used then thats ok.
^ This is my pc and NN specs
^ This is what it looks like but its not really that important though, and i don't plan to explain the meaning of the numbers.
Open a (standalone) profiler window, record some data first. There is hardly anything to talk about otherwise
That would be used for optimizing the code which as I said is not an option. I am asking if Ican let unity use more of things like your computers ram cpu or gpu. By default it uses a very small amount of what can be used on my computer IE "12% CPU, 45% memory, 6% GPU" is whats being used when its doing the most calculations. I can't optimize the code itself because every single calculation is required other than small ones that have no effect. Everything that can be optimized is.
Not necessarily. Profiler allows you to see what your CPU is doing in context of this unity application - in both detail and in overview.That would be used for optimizing the code
I'm not sure where is that "12% CPU" stat is coming from and what it means exactly. But it might be telling you that you have many cores and only one of them is busy doing all the work. Whatever the answer - important thing to know.
Also, Profiler can tell how much time your app is spending doing the UI work. Inefficient or buggy UI can tank the fps too.
I'll give a bit more background to what it is. There are 200 NNs each with around 200 inputs, 700 nodes, and over 750mil weights and biases. The nodes are calculated 10 times per frame using the weights and biases. In other words its a math problem with over 750mil numbers being calculated 2000 times per frame with different numbers. I need it to be calculated as many times in a second as it can be. I need to give it more of my pc to use not make it use less of what it has.
I need to give it more of my pc
I totally sympathize with your sentiment, but this is not how computers work.
Improving program performance is done by either optimizing bottlenecks or multithreading it. Without any profiling at all, you can can have gazilion numbers being crunched by a single thread where the other 11 has nothing to do, or worse: your CPU can be stuck on UI code doing nothing important and wasting his/your time.
andrew already correctly layed out all issues with your question. why is optimizing your code not an option?
Answer by VanToRiaXVII · Mar 11 at 04:31 PM
You can make your code multi-thread using Unity DOTS (https://learn.unity.com/tutorial/what-is-dots-and-why-is-it-important?signup=true#5ef9fe65edbc2a002094eff5)
You can find a high-clock CPU on the cloud, which would allow you to make more calculations in the same amount of time.
You could use more of your GPU instead of relying on the CPU to do all the work. Here's a project that uses C# to call the GPU and use its processing power to do the required calculations: https://github.com/lepoco/CUDAfy.NET
Here's an implementation of that project: https://w8isms.blogspot.com/2013/04/gpgpu-performance-tests.html
Your answer
Follow this Question
Related Questions
VideoPlayer is choppy while preparing and before playing. 0 Answers
Batching problem. (objects with shared material are not being batched) 2 Answers
Wich one of these is Less CPU Consuming? 0 Answers
Why is the CPU usage so high? 1 Answer
Why do my Coroutines allocate memory when they execute? 1 Answer