Skip to content

Commit

Permalink
vcache: Replace score table with results of vcachetuner
Browse files Browse the repository at this point in the history
The new tables have been generated by a ~3-day 64-core run of
vcachetuner optimizing for AMD GCN & NVidia Pascal profiles. In general
the new tables show small improvements across the board on many meshes
(in the 1-2% range), are mostly flat on other cache profiles (e.g.
Intel), and sometimes have a <1% penalty. The overall gain in terms of
average improvement is around 1% on a test mesh set.

One distinguishing mesh, however, is a regular grid, where the new
tables are ~6% better on NV, ~9% better on AMD, ~10% better on Intel -
with the new tables the results are much closer to FIFO algorithm so
unless optimization time is an issue this algorithm is finally on par or
better than FIFO (it's still slightly worse on regular grids on AMD with
~2% worse ACMR, but it's slightly better on NVidia).

Finally, it's worth noting that since the new tables were learned tabula
rasa, the insight-driven scoring formulas from before need not apply.
It's also possible to retrain the algorithm targeting a particular
hardware to get better results (tuning *just* for AMD ends up producing
even better results).
  • Loading branch information
zeux committed Dec 27, 2017
1 parent 2011090 commit 18f0220
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/vcacheoptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,14 @@ static unsigned int getNextVertexNeighbour(const unsigned int* next_candidates_b
const size_t max_cache_size = 16;
const size_t max_valence = 8;

// last_triangle_score = 0.8, cache_decay_power = 1.5
static const float vertex_score_table_cache[1 + max_cache_size] = {
0.000000f,
0.800000f, 0.800000f, 0.800000f, 1.000000f, 0.948724f, 0.898356f, 0.848913f, 0.800411f,
0.752870f, 0.706309f, 0.660750f, 0.616215f, 0.572727f, 0.530314f, 0.489003f, 0.448824f,
0.f,
0.792f, 0.767f, 0.764f, 0.956f, 0.827f, 0.751f, 0.820f, 0.864f, 0.738f, 0.788f, 0.642f, 0.646f, 0.165f, 0.654f, 0.545f, 0.284f
};

// valence_boost_scale = 3.2, valence_boost_power = 0.9
static const float vertex_score_table_live[1 + max_valence] = {
0.000000f,
3.200000f, 1.714838f, 1.190531f, 0.918959f, 0.751756f, 0.637990f, 0.555344f, 0.492458f,
0.f,
0.994f, 0.721f, 0.479f, 0.423f, 0.174f, 0.080f, 0.249f, 0.056f
};

static float vertexScore(int cache_position, unsigned int live_triangles)
Expand Down

0 comments on commit 18f0220

Please sign in to comment.