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

Enable cache line locking support in SSD kernel #2949

Closed
wants to merge 2 commits into from

Conversation

sryap
Copy link
Contributor

@sryap sryap commented Aug 8, 2024

Summary:
This diff enables cache line locking in
ssd_cache_actions_insert_kernel.

We updated the cache slot cost computation (within a cache set) to
facilitate the cache line locking logic. Before this diff, the cache
slots are ranked based on the their costs (i.e., their timestamps
which can be retrieved from the cache state). The cache slots that
contain the lowest costs (lowest timestamps) will be evicted first.

However, when cache line locking is enabled, the cache slot that has
the lowest timestamp cannot be used if it is locked. Therefore, we
assign unavailable cache slots (i.e., being locked or being occupied
by another index in the same batch) with the highest cost (that is the
current timestamp). The slot will not be evicted if its cost is the
same as the current timestamp.

Differential Revision: D60812956

Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit e0fb4d4
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/66bb8e0344499900081a9872
😎 Deploy Preview https://deploy-preview-2949--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60812956

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60812956

sryap added a commit to sryap/FBGEMM that referenced this pull request Aug 8, 2024
Summary:
X-link: facebookresearch/FBGEMM#51

Pull Request resolved: pytorch#2949

This diff enables cache line locking in
`ssd_cache_actions_insert_kernel`.

We updated the cache slot cost computation (within a cache set) to
facilitate the cache line locking logic.  Before this diff, the cache
slots are ranked based on the their costs (i.e., their timestamps
which can be retrieved from the cache state).  The cache slots that
contain the lowest costs (lowest timestamps) will be evicted first.

However, when cache line locking is enabled, the cache slot that has
the lowest timestamp cannot be used if it is locked.  Therefore, we
assign unavailable cache slots (i.e., being locked or being occupied
by another index in the same batch) with the highest cost (that is the
current timestamp). The slot will not be evicted if its cost is the
same as the current timestamp.

Differential Revision: D60812956
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60812956

sryap added a commit to sryap/FBGEMM that referenced this pull request Aug 8, 2024
Summary:
X-link: facebookresearch/FBGEMM#51

Pull Request resolved: pytorch#2949

This diff enables cache line locking in
`ssd_cache_actions_insert_kernel`.

We updated the cache slot cost computation (within a cache set) to
facilitate the cache line locking logic.  Before this diff, the cache
slots are ranked based on the their costs (i.e., their timestamps
which can be retrieved from the cache state).  The cache slots that
contain the lowest costs (lowest timestamps) will be evicted first.

However, when cache line locking is enabled, the cache slot that has
the lowest timestamp cannot be used if it is locked.  Therefore, we
assign unavailable cache slots (i.e., being locked or being occupied
by another index in the same batch) with the highest cost (that is the
current timestamp). The slot will not be evicted if its cost is the
same as the current timestamp.

Differential Revision: D60812956
sarunya and others added 2 commits August 12, 2024 12:39
Differential Revision: D60413116
Summary:
X-link: facebookresearch/FBGEMM#51

Pull Request resolved: pytorch#2949

This diff enables cache line locking in
`ssd_cache_actions_insert_kernel`.

We updated the cache slot cost computation (within a cache set) to
facilitate the cache line locking logic.  Before this diff, the cache
slots are ranked based on the their costs (i.e., their timestamps
which can be retrieved from the cache state).  The cache slots that
contain the lowest costs (lowest timestamps) will be evicted first.

However, when cache line locking is enabled, the cache slot that has
the lowest timestamp cannot be used if it is locked.  Therefore, we
assign unavailable cache slots (i.e., being locked or being occupied
by another index in the same batch) with the highest cost (that is the
current timestamp). The slot will not be evicted if its cost is the
same as the current timestamp.

Reviewed By: ehsanardestani

Differential Revision: D60812956
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60812956

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 19990d8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants