From b1456cfc0bf191b10bc57c28322e515911456f46 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 12 Oct 2011 23:59:38 +0000 Subject: [PATCH] - scheduler: fix a bug that would choose app versions erroneously. The problem: the choice of app version was based on the "projected FLOPS" return by estimate_flops(av). If usage stats exist for the host / app version, this returns a number X such that WU.rsc_fpops_est/X approximates the runtime of a job using the given app version.. (If WU.rsc_fpops_est is way off, this will be correspondingly way off from the actual FLOPS the app version will get.) However, if there are no usage stats, it return an estimate based on host hardware speed, which might be 100X less. Hence, in some cases a new app version would never get used. Solution: choose app versions based on the values returned by the app plan functions. Use estimate_flops() AFTER choosing the version. - scheduler: improve the accuracy of FLOPS estimation for GPU apps. The "flops_scale" argument to coproc_perf (which expresses the difference between peak GPU FLOPS and actual FLOPS) should be used to scale GPU FLOPS prior to calling coproc_perf(), rather than scaling the estimate returned by coproc_perf(). - show_shmem: show have_X_apps flags svn path=/trunk/boinc/; revision=24385 --- checkin_notes | 31 +++++++++++++++++++++++++++++++ sched/sched_customize.cpp | 3 +-- sched/sched_shmem.cpp | 10 ++++++++++ sched/sched_version.cpp | 3 +-- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 5ff7a46cb8..b306deb784 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7122,3 +7122,34 @@ Rom 11 Oct 2011 / configure.ac version.h + +David 11 Oct 2011 + - scheduler: fix a bug that would choose app versions erroneously. + The problem: the choice of app version was based on + the "projected FLOPS" return by estimate_flops(av). + If usage stats exist for the host / app version, + this returns a number X such that + WU.rsc_fpops_est/X approximates the runtime of a job + using the given app version.. + (If WU.rsc_fpops_est is way off, this will be correspondingly way off + from the actual FLOPS the app version will get.) + However, if there are no usage stats, + it return an estimate based on host hardware speed, + which might be 100X less. + Hence, in some cases a new app version would never get used. + + Solution: choose app versions based on the values + returned by the app plan functions. + Use estimate_flops() AFTER choosing the version. + - scheduler: improve the accuracy of FLOPS estimation for GPU apps. + The "flops_scale" argument to coproc_perf + (which expresses the difference between peak GPU FLOPS + and actual FLOPS) should be used to scale GPU FLOPS + prior to calling coproc_perf(), + rather than scaling the estimate returned by coproc_perf(). + - show_shmem: show have_X_apps flags + + sched/ + sched_customize.cpp + sched_version.cpp + sched_shmem.cpp diff --git a/sched/sched_customize.cpp b/sched/sched_customize.cpp index 7bf6a9347e..ea30132066 100644 --- a/sched/sched_customize.cpp +++ b/sched/sched_customize.cpp @@ -446,14 +446,13 @@ static inline bool opencl_check( coproc_perf( g_request->host.p_fpops, - ndevs * cp.peak_flops, + flops_scale * ndevs * cp.peak_flops, cpu_frac, hu.projected_flops, hu.avg_ncpus ); hu.peak_flops = ndevs*cp.peak_flops + hu.avg_ncpus*g_request->host.p_fpops; hu.max_ncpus = hu.avg_ncpus; - hu.projected_flops *= flops_scale; return true; } diff --git a/sched/sched_shmem.cpp b/sched/sched_shmem.cpp index e59593800f..25757a04c9 100644 --- a/sched/sched_shmem.cpp +++ b/sched/sched_shmem.cpp @@ -174,6 +174,8 @@ int SCHED_SHMEM::scan_tables() { APP_VERSION& av = app_versions[i]; if (strstr(av.plan_class, "cuda")) { have_cuda_apps = true; + } else if (strstr(av.plan_class, "nvidia")) { + have_cuda_apps = true; } else if (strstr(av.plan_class, "ati")) { have_ati_apps = true; } else { @@ -267,6 +269,14 @@ void SCHED_SHMEM::show(FILE* f) { av.appid, av.platformid, av.version_num, av.plan_class ); } + fprintf(f, + "have CPU: %s\n" + "have NVIDIA: %s\n" + "have ATI: %s\n", + have_cpu_apps?"yes":"no", + have_cuda_apps?"yes":"no", + have_ati_apps?"yes":"no" + ); fprintf(f, "Jobs; key:\n" "ap: app ID\n" diff --git a/sched/sched_version.cpp b/sched/sched_version.cpp index 96f861eafb..f15eec92c8 100644 --- a/sched/sched_version.cpp +++ b/sched/sched_version.cpp @@ -746,8 +746,6 @@ BEST_APP_VERSION* get_app_version( // found_feasible_version = true; - estimate_flops(host_usage, av); - // pick the fastest version. // Throw in a random factor in case the estimates are off. // @@ -766,6 +764,7 @@ BEST_APP_VERSION* get_app_version( } // loop over client platforms if (bavp->avp) { + estimate_flops(bavp->host_usage, *bavp->avp); if (config.debug_version_select) { log_messages.printf(MSG_NORMAL, "[version] Best version of app %s is [AV#%d] (%.2f GFLOPS)\n",