Exemple #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);
        }
Exemple #2
0
        public void Warmup(bool alsoCalcStatistics)
        {
            if (alsoCalcStatistics)
            {
                Parallel.Invoke(
                    () => CalcStatistics(true),
                    () => { if (Evaluator2 is not null)
                            {
                                NNEvaluatorBenchmark.Warmup(Evaluator2);
                            }
                    }
//          () => { if (EvaluatorSecondary is not null) NNEvaluatorBenchmark.Warmup(EvaluatorSecondary); }
                    );
            }
            else
            {
                Parallel.Invoke(
                    () => NNEvaluatorBenchmark.Warmup(Evaluator1),
                    () => { if (Evaluator2 is not null)
                            {
                                NNEvaluatorBenchmark.Warmup(Evaluator2);
                            }
                    }
//          () => { if (EvaluatorSecondary is not null) NNEvaluatorBenchmark.Warmup(EvaluatorSecondary); }
                    );
            }
        }