Beispiel #1
0
        /// <summary>
        /// Dumps GPU information and runs benchmarks.
        /// </summary>
        /// <returns>Sum of NPS across all GPUs</returns>
        public static (int CountGPU, int SumNPS) DumpGPUBenchmark()
        {
            Console.WriteLine();
            Console.WriteLine("-----------------------------------------------------------------------------------");
            Console.WriteLine($"GPU BENCHMARK (benchmark net: {CeresUserSettingsManager.Settings.DefaultNetworkSpecString})");
            Console.WriteLine();
            Console.WriteLine(NVML.InfoDescriptionHeaderLine1 + "   NPS 1  NPS Batch");
            Console.WriteLine(NVML.InfoDescriptionHeaderLine2 + "   -----  ---------");

            int sumNPS   = 0;
            int countGPU = 0;

            foreach (NVMLGPUInfo info in NVML.GetGPUsInfo())
            {
                NNEvaluatorDef evaluatorDef = NNEvaluatorDef.FromSpecification(CeresUserSettingsManager.Settings.DefaultNetworkSpecString,
                                                                               "GPU:" + info.ID.ToString());
                NNEvaluator evaluator = NNEvaluatorFactory.BuildEvaluator(evaluatorDef);
                (float npsSingletons, float npsBigBatch, _) = NNEvaluatorBenchmark.EstNPS(evaluator, false, 512, true, 3);

                Console.WriteLine(NVML.GetInfoDescriptionLine(info) + $"    {npsSingletons,6:N0} { npsBigBatch,10:N0}");

                countGPU++;
                sumNPS += (int)npsBigBatch;

                evaluator.Dispose();
            }

            return(countGPU, sumNPS);
        }
Beispiel #2
0
 NNEvaluator MakeEvaluator()
 {
     return(NNEvaluatorFactory.BuildEvaluator(EvaluatorDef));
 }