Changes between Version 24 and Version 25 of CreditNew


Ignore:
Timestamp:
Mar 10, 2010, 9:02:47 AM (14 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CreditNew

    v24 v25  
    108108
    109109When a job J is issued to a host,
    110 the scheduler specifies flops_est(J),
    111 a FLOPS estimate based on the resources used by the job
    112 and their peak speeds.
     110the scheduler computes peak_flops(J)
     111based on the resources used by the job and their peak speeds.
    113112
    114113If the job is finished in elapsed time T,
    115114we define peak_flop_count(J), or PFC(J) as
    116115{{{
    117 PFC(J) = T * (sum over devices D (usage(J, D) * peak_flop_rate(D))
     116PFC(J) = T * peak_flops(J)
    118117}}}
    119118
    120119Notes:
    121120
    122  * PFC(J) is
    123121 * We use elapsed time instead of actual device time (e.g., CPU time).
    124122   If a job uses a resource inefficiently
     
    127125   The key thing is that BOINC reserved the device for the job,
    128126   whether or not the job used it efficiently.
    129  * usage(J,D) may not be accurate; e.g., a GPU job may take
     127 * peak_flops(J) may not be accurate; e.g., a GPU job may take
    130128   more or less CPU than the scheduler thinks it will.
    131129   Eventually we may switch to a scheme where the client
     
    134132 * For projects (CPDN) that grant partial credit via
    135133   trickle-up messages, substitute "partial job" for "job".
    136    These projects must include elapsed time,
    137    app version ID, and FLOPS estimate in the trickle message.
    138 
    139 The granted credit for a job J is proportional to PFC(J),
     134   These projects must include elapsed time and result ID
     135   in the trickle message.
     136
     137The credit for a job J is proportional to PFC(J),
    140138but is normalized in the following ways:
    141139
     140== ''A priori'' job size estimates ==
     141
     142If we have an ''a priori'' estimate of job size,
     143we can normalize by this to reduce the variance
     144of various distributions (see below).
     145This makes estimates of the means converge more quickly.
     146
     147We'll use workunit.rsc_fpops_est as this a priori estimate,
     148and we'll denote it E(J).
     149
     150''A posteriori'' estimates of job size may exist also
     151(e.g., an iteration count reported by the app)
     152but using this for anything introduces a new cheating risk,
     153so it's probably better not to.
     154
    142155== Cross-version normalization ==
    143156
    144157If a given application has multiple versions (e.g., CPU and GPU versions)
    145 the granted credit per job is adjusted
     158the credit per job is adjusted
    146159so that the average is the same for each version.
    147160
    148 We maintain the average PFC^mean^(V) of PFC() for each app version V.
     161We maintain the average PFC^mean^(V) of PFC(J)/E(J) for each app version V.
    149162We periodically compute PFC^mean^(CPU) and PFC^mean^(GPU),
    150163and let X be the min of these.
     
    153166 S(V) = (X/PFC^mean^(V))
    154167
    155 The result for a given job J
    156 is called "Version-Normalized Peak FLOP Count", or VNPFC(J):
     168The "Version-Normalized Peak FLOP Count", or VNPFC(J) is
    157169
    158170 VNPFC(J) = S(V) * PFC(J)
    159171
    160172Notes:
    161  * This addresses the common situation
     173 * Version normalization addresses the common situation
    162174   where an app's GPU version is much less efficient than the CPU version
    163175   (i.e. the ratio of actual FLOPs to peak FLOPs is much less).
     
    167179   It's not exactly "Actual FLOPs", since the most efficient
    168180   version may not be 100% efficient.
    169  * There are two sources of variance in PFC(V):
    170    the variation in host efficiency,
    171    and possibly the variation in job size.
    172    If we have an ''a priori'' estimate of job size
    173    (e.g., workunit.rsc_fpops_est)
    174    we can normalize by this to reduce the variance,
    175    and make PFC^mean^(V) converge more quickly.
    176  * ''a posteriori'' estimates of job size may exist also
    177    (e.g., an iteration count reported by the app)
    178    but using this for anything introduces a new cheating risk,
    179    so it's probably better not to.
    180181
    181182== Cross-project normalization ==
    182183
    183184If an application has both CPU and GPU versions,
    184 then the version normalization mechanism uses the CPU
    185 version as a "sanity check" to limit the credit granted to GPU jobs.
     185the version normalization mechanism uses the CPU
     186version as a "sanity check" to limit the credit granted to GPU jobs
     187(or vice versa).
    186188
    187189Suppose a project has an app with only a GPU version,
     
    194196then for each version V we let
    195197S(V) be the average scaling factor
    196 for that plan class among projects that do have both CPU and GPU versions.
     198for that resource type among projects that have both CPU and GPU versions.
    197199This factor is obtained from a central BOINC server.
    198200V's jobs are then scaled by S(V) as above.
     
    200202Notes:
    201203
    202  * wu use plan class,
    203    since e.g. the average efficiency of CUDA 2.3 apps may be different
    204    than that of CUDA 2.1 apps.
    205  * Initially we'll obtain scaling factors from large projects
    206    that have both GPU and CPU apps (e.g., SETI@home).
    207    Eventually we'll use an average (weighted by work done)
    208    over multiple projects (see below).
     204 * The "average scaling factor" is weighted by work done.
    209205
    210206== Host normalization ==
     
    214210Then the average credit per job should be the same for all hosts.
    215211To ensure this, for each app version V and host H
    216 we maintain PFC^mean^(H, A).
     212we maintain PFC^mean^(H, A),
     213the average of PFC(J)/E(J) for jobs completed by H using A.
    217214The '''claimed FLOPS''' for a given job J is then
    218215
     
    228225 * GPUGrid.net's scheme for sending some (presumably larger)
    229226   jobs to GPUs with more processors.
    230 In these cases average credit per job must differ between hosts,
    231 according to the types of jobs that are sent to them.
    232 
    233 This can be done by dividing
    234 each sample in the computation of PFC^mean^ by WU.rsc_fpops_est
    235 (in fact, there's no reason not to always do this).
     227
     228The normalization by E(J) handles this
     229(assuming that wu.fpops_est is set appropriately).
    236230
    237231Notes:
     
    240234   and increases the claimed credit of hosts that are more efficient
    241235   than average.
    242  * PFC^mean^ is averaged over jobs, not hosts.
    243236
    244237== Computing averages ==
     
    247240
    248241 * The quantities being averaged may gradually change over time
    249    (e.g. average job size may change,
    250    app version efficiency may change as new versions are deployed)
     242   (e.g. average job size may change)
    251243   and we need to track this.
    252244 * A given sample may be wildly off,
    253245   and we can't let this mess up the average.
    254246
    255 In addition, we may as well maintain the variance of the quantities,
    256 although the current system doesn't use it.
    257 
    258 The code that does all this is
     247The code that does this is
    259248[http://boinc.berkeley.edu/trac/browser/trunk/boinc/lib/average.h here].
    260249
     
    281270and sets their scaling factor based on the above.
    282271
     272== Anonymous platform ==
     273
     274For anonymous platform apps, since we don't reliably
     275know anything about the devices involved,
     276we don't try to estimate PFC.
     277
     278For each app, we maintain claimed_credit^mean^(A),
     279the average of claimed_credit(J)/E(J).
     280
     281The claimed credit for anonymous platform jobs is
     282
     283 claimed_credit^mean^(A)*E(J)
     284
     285The server maintains host_app_version records for anonymous platform,
     286and it keeps track of elapsed time statistics there.
     287These have app_version_id = -1 for CPU, -2 for NVIDIA GPU, -3 for ATI.
     288
     289== Replication ==
     290
     291We take the set of hosts that
     292are not anon platform and not on scale probation (see below).
     293If this set is nonempty, we grant the average of their claimed credit.
     294Otherwise we grant
     295
     296 claimed_credit^mean^(A)*E(J)
     297
    283298== Cheat prevention ==
    284299
     
    286301by claiming excessive credit
    287302(i.e., by falsifying benchmark scores or elapsed time).
    288 An exaggerated claim will increase VNPFC*(H,A),
    289 causing subsequent claimed credit to be scaled down proportionately.
     303An exaggerated claim will increase PFC^mean^(H,A),
     304causing subsequent credit to be scaled down proportionately.
    290305
    291306This means that no special cheat-prevention scheme
     
    293308in this case, granted credit = claimed credit.
    294309
    295 For jobs that are replicated,
    296 granted credit is set to:
    297  * if the larger host is on scale probation, the smaller
    298  * if larger > 2*smaller, granted = 1.5*smaller
    299  * else granted = (larger+smaller)/2
    300 
    301310However, two kinds of cheating still have to be dealt with:
    302311
     
    304313
    305314For example, claiming a PFC of 1e304.
    306 This can be minimized by
    307 capping VNPFC(J) at some multiple (say, 20) of VNPFC^mean^(A).
    308 If this is enforced, the host's error rate is set to the initial value,
     315
     316If PFC(J) exceeds some multiple (say, 20) of PFC^mean^(V),
     317the host's error rate is set to the initial value,
    309318so it won't do single replication for a while,
    310319and scale_probation (see below) is set to true.
     
    351360In addition, to limit the extent of cheating
    352361(in case the above mechanism is defeated somehow)
    353 the host scaling factor will be min'd with a
    354 project-wide config parameter (default, say, 3).
    355 
    356 == Trickle credit ==
    357 
    358 CPDN breaks jobs into segments,
    359 has the client send a trickle-up message on completion of each segment,
    360 and grants credit in the trickle-up handler.
    361 
    362 In this case, the trickle-up message should include
    363 the incremental elapsed time of the the segment.
    364 The trickle-up handler should then call {{{compute_claimed_credit()}}}
    365 (see below) to determine the claimed credit.
    366 In this case segments play the role of jobs in the credit-related DB fields.
     362the host scaling factor will be min'd with a constant (say, 3).
    367363
    368364== Error rate, host punishment, and turnaround time estimation ==
     
    390386so we'll move "max_results_day" from the host table to host_app_version.
    391387
    392 == Anonymous platform ==
    393 
    394 For anonymous platform apps, since we don't necessarily
    395 know anything about the devices involved,
    396 we don't try to estimate PFC.
    397 Instead, we give the average credit for the app,
    398 scaled by the job size.
    399 
    400 The server maintains host_app_version record for anonymous platform,
    401 and it keeps track of elapsed time statistics there.
    402 These have app_version_id = -1 for CPU, -2 for NVIDIA GPU, -3 for ATI.
    403 
    404388== App plan functions ==
    405389
     
    479463
    480464
     465