Add additive L2 stat for NVIDIA-comparable write hits (GAME CHANGER!!!) - #141
Conversation
|
Table for ISPASS-2009
My next plan:
|
|
Just cracked another case. My theory was correct. It was another counter. A FIX: accel-sim/accel-sim-framework@7f83680 (Note that everything I discussed below will be from the commit above) NVIDIA's Instead of only prints I found this bug when checking the run files of
And when we add I reran this with And the results for This fixed not only 1, but 2 tests (which is The reason why Since there was no spilling in This is Another Issue (Modeling Gap)I then investigated the kernels of And since we are using If we look at
For now it's out of scope, but I'll look into those 2 apps further RelatedFor the beautiful dashboard: accel-sim/accel-sim-framework#549 (please include this PR I love this dashboard) |
|
Yea I assume you are on Ampere? The ltcfabric is not that important. On Hopper and Blackwell it's more important. But I think this counter is just busted lol. I'm using total L2 access lts__sectors minus the srcunit_tex one to get cross partition/chiplet access. If you want this to be merged you need get this finished this week. We are planning on a new release soon. If you can get this ready I can try to merge this before the new release. Otherwise the memory subsystem changed a lot in the new release. |
|
Also I don't think RTX Ampere has partitioned L2? I might be wrong tho. |
SummaryAdded a merge buffer between Motivation / root cause
Changes
Evidence (before / after)
To my surprise, the merger actually fixes most of the issue. Across 32 apps (ispass-2009, rodinia 2.0-ft, GPU_Microbenchmark) with a 4-entry buffer:
19 apps stay bit-identical, and the worst collateral change anywhere is
ConclusionYou know what? L2 counters might be busted 🥀😭. I think that hardware distinguishes two instruction streams that differ only by loop-control instructions between the same stores. The cache can't observe that, so this likely belongs in the LSU or access-generation path rather than in I do think that there's a solution to this. However, due to the potential architectural changes I'd have to implement + time constraint + the memory subsystem is going to change drastically in the new release, I'm gonna stop here with this merging implementation. But apart from this new architectural fix, I would say the previous PRs are mergable (the PR above this where we use Also can you check out this parser issue: #138? I think it's pretty significant when running in PTX mode. (also don't forget my beautiful dashboard too) |
|
please run the formatter. |
|
my bad i just fixed it |
|
You probably might want to check out accel-sim/accel-sim-framework@7f83680 too since it contains the |




Summary
Adds a stats-only
WRITE_ALLOCATEDcounter so an NVIDIA-comparable L2 write-hit estimate (HIT + WRITE_ALLOCATED) can be correlated. If this works as assumed this might be a game changer.Motivation / root cause
On streaming-write ubenchmarks the sim reports ~0%
L2 write-hitwhile HW reports ~100%, giving a negative correlation (−0.05 to −0.12). Also on multiple testsL2 write-hitundercounts in sim compared to hw run (off by A LOT !). However, on some other tests the sim counter matches the hw counters exactly. This leads me to believe that there is another stats we did not account in while calculatingL2 write-hit.After some testing, I've come to the conclustion that a write to a never-read line is a
MISSinwr_miss_wa_lazy_fetch_on_read, (the config that we used for testing) (all four write-allocate handlers returnMISS), but the line is allocated. In this case NVIDIA counts it as aHIT(totally assumed here).Changes
gpu-cache.h: newcache_request_status::WRITE_ALLOCATED(stats-only, never returned fromaccess())gpu-cache.cc: string entry; exclude fromTOTAL_ACCESS; increment inprocess_tag_probewhen a write miss allocates under a write-allocate policy.Evidence (before / after)
Before: L2 Write Hits correlation: −0.05 (streaming ubenchs)
strict
HITunder-counts (srad_v2 sim 4128 vs HW 24576).After:


HIT + WRITE_ALLOCATEDcorrelation 0.999 on 10 rodinia apps.Test plan
./format-code.sh cleangrep "GLOBAL_ACC_W\]\[WRITE_ALLOCATED\]"appears in sim stdoutHIT/MISS/TOTAL_ACCESSbyte-identical to a pre-change build (additive check)Compatibility / backward compatibility
Fully additive
Limitations / known gaps
HIT + WRITE_ALLOCATEDis an estimate, not an exact reproduction of NVIDIA's (undocumented) definition. Validated across two suites: rodinia_2.0-ft (mostly correct) and ISPASS-2009 (4/6 reasonable with 2 hard outliers: RAY 16× under, STO 3× over).DRAM Read&L2 Readlooks extremely ugly in these tests (not caused by my counter of course). I will look more into this in the futureRelated
accel-sim/accel-sim-framework#518 (L2 seems to be a big problem with the tuner)
Sometimes L2 hit rate can exceed 100%, which is a problem documented by NVIDIA https://forums.developer.nvidia.com/t/l2-hit-rate-more-than-100/244570