Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-tier CacheLib part 2 #357

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

byrnedj
Copy link
Contributor

@byrnedj byrnedj commented Dec 10, 2024

Multi-tier allocator patch part 2 introduces eviction and promotion among the tiers, the multi-tier stats and some additional multi-tier tests. With this setup tier 1 and tier 2 are exclusive L1 and L2 caches respectively.

We have introduced some optimizations to reduce the overhead of the data movement:

  • Linking with DTO (see https://github.com/intel/DTO) to enable the Data Streaming Accelerator on Intel 4th Gen Xeon Sapphire Rapids)
  • Only moving the item to the next tier if it was accessed (otherwise just evict) using the evictIfNotAccessed option.

byrnedj and others added 5 commits December 10, 2024 08:54
This is the implementation logic for the background eviction (and promotion when multi-tier is enabled).

The main parameters for the background workers are the number of threads, `backgroundMoverThreads` and the batch size used `backgroundEvictionBatch`, which configures the number of items to evict in batch (while holding the container lock), and `backgroundTargetFree` which sets target free percentage of each class. The background workers will work to keep that percentage of space free.

The main result is that SET (allocate) latencies are significantly reduced - kvcache workload with 40GB DRAM, ampFactor set to 200 via the trace replayer. Throughput set at 1.2M ops/sec.
| Percentile | % Improvement |
|------------|---------------|
| 0.50000    |     70.4      |
| 0.90000    |     23.0      |
| 0.99000    |     12.2      |
| 0.99900    |     89.7      |
| 0.99990    |     24.9      |
| 0.99999    |     0.6       |

The GET (find) latencies are unaffected by the background workers as long as the batch size remains reasonably small (10 in our tests).
This includes printing:
- allocSize
- allocated memory size
- memory usage fraction
Part 1.
-----------------------------------------
This includes the following:
 - Multi-tier allocator with TierId
 - allocateInternalTier
 - creating multi-tier allocator on shared memory
 - serialization
 - some basic tests
 - Add option to insert items to first free tier, this enables
   an interleaving approach. Ther is no data movement among
   the tiers. Use `insertToFirstFreeTier` option to control.
   In order to evict data from the second tier, you will need
   to have the background movers enabled.
Part 2.
----------------------------
This patch introduces tryEvictToNextMemoryTier (the actual data
movement), multi-tier stats and some additional multi-tier tests.
- Includes MM2Q support for promotion
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants