You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are seeing that a lot of native threads are being created (probably because the number is set as a multiple of the number of cores) and not really doing anything.
Is there a way to specify the number of threads?
Alternatives
No response
The text was updated successfully, but these errors were encountered:
Answering my own question, in the version we are using (0.60.4) it seems we can do it via:
using var options = c_api.TF_NewSessionOptions();
var config = new ConfigProto
{
InterOpParallelismThreads = X,
IntraOpParallelismThreads = Y
};
var cfgByteArray = config.ToByteArray();
fixed (byte* cfgPtr = cfgByteArray)
{
using var status = new Status();
c_api.TF_SetConfig(options, (IntPtr)cfgPtr, (ulong)cfgByteArray.Length, status.Handle);
status.Check(true);
}
Description
We are seeing that a lot of native threads are being created (probably because the number is set as a multiple of the number of cores) and not really doing anything.
Is there a way to specify the number of threads?
Alternatives
No response
The text was updated successfully, but these errors were encountered: