Does the result of machine learning with Tensorflow depend on PC specifications?

Asked 1 years ago, Updated 1 years ago, 319 views

We are currently conducting research on reinforcement learning in machine learning at school.
So, I would like to ask you one question: Is the result of reinforcement learning dependent on the specifications of the PC used?
I'm wondering if the results of the same study are legitimate for comparison between a PC with a GPU and a PC without a GPU.

I understand that the actual time you spend studying will change a lot, but I would like to know if there are any other changes depending on the specifications.

The primary environment is
python 3.8
tensorflow 2.2.0
Keras
Keras-rl

os assumes Windows 10, Mac, and Google Colab.

python tensorflow keras gpu

2022-09-30 21:53

3 Answers

It should not change.The logic doesn't change.Of course, if there are no bugs...


2022-09-30 21:53

I don't know how long this answer will be useful because it's a highly variable field, but for your information. (We also welcome intellectuals.)

The contents of the program vary greatly when comparing CPU only to CPU+GPU.
If you are calling from the library, you are not very conscious, but the internal processing is quite different.

When using common GPUs together, "transferring data together" occurs for faster speeds.
Because the devices themselves are different, the amount of time it takes to communicate data between them becomes a level that cannot be ignored.
In addition, GPUs are not as versatile as CPUs because they operate differently.I'm just specializing in making similar calculations.

What this means is that depending on the program you are running and the data you are using (especially the amount of data), only the CPU runs faster.

There are calculations that need to be done by the CPU, and if the calculation is large, there is little benefit to using a GPU.
GPUs are usually used only for calculations that GPUs are good at.
So the calculation results are basically the same.Either way, I also use the CPU where I need it. (Except for malfunctions and bugs)

Also, if the amount of data to be calculated is small, the time it takes to transfer will be more problematic.This also eliminates the advantages of using a GPU, and the disadvantages are greater.
This also means, on the contrary, that if the amount of data is larger than the GPU's memory, some programs will never be able to calculate it.

In other words,

If I let them learn the same thing on a PC with and without a GPU, is the result legitimately a comparison?

When considering this, there are cases where only the CPU is the normal result in the learning process, and if the CPU+GPU result contains errors, it is not a comparison object.It's controversial whether to view this as a bug or a program or device specification...


2022-09-30 21:53

TensorFlow 2.8 and later have the ability to enable op determinism and use the same hardware, the same software version (such as OS/CUDA/TensorFlow) for reproducibility.

Conversely, in the case of the question, TensorFlow 2.2.0 has different hardware and software, so the results do not exactly match.
Basically, the difference with TensorFlow is not the difference between 1+1 and 2 or 3, but the result of random numbers and the range of numerical accuracy.

Perhaps there is not much difference in behavior itself as seen in the macro of reinforcement learning, but the parameters of the model obtained when viewed from a micro perspective are often completely different.


2022-09-30 21:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.