-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update TensorRT-LLM --------- Co-authored-by: Starrick Liu <[email protected]>
- Loading branch information
1 parent
340a1b6
commit aaacc9b
Showing
459 changed files
with
858,777 additions
and
364,419 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
# Ref: https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues | ||
name: Close inactive issues | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 * * * *" | ||
- cron: "30 1 * * *" | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/stale@v9 | ||
with: | ||
days-before-issue-stale: 30 | ||
days-before-issue-close: 15 | ||
stale-issue-label: "stale" | ||
exempt-issue-labels: "" | ||
stale-issue-message: This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 15 days." | ||
close-issue-message: "This issue was closed because it has been stalled for 15 days with no activity." | ||
days-before-pr-stale: -1 | ||
days-before-pr-close: -1 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'Issue has not received an update in over 14 days. Adding stale label.' | ||
stale-pr-message: 'PR has not received an update in over 14 days. Adding stale label.' | ||
close-issue-message: 'This issue was closed because it has been 14 days without activity since it has been marked as stale.' | ||
close-pr-message: 'This PR was closed because it has been 14 days without activity since it has been marked as stale.' | ||
days-before-issue-stale: 14 | ||
days-before-close: 14 | ||
only-labels: 'waiting for feedback' | ||
labels-to-add-when-unstale: 'investigating' | ||
labels-to-remove-when-unstale: 'stale,waiting for feedback' | ||
stale-issue-label: 'stale' | ||
stale-pr-label: 'stale' | ||
debug-only: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
cpp/include/tensorrt_llm/batch_manager/kvCacheTransferManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "tensorrt_llm/batch_manager/kvCacheManager.h" | ||
#include "tensorrt_llm/runtime/bufferManager.h" | ||
#include "tensorrt_llm/runtime/cudaEvent.h" | ||
|
||
namespace tr = tensorrt_llm::runtime; | ||
|
||
#pragma once | ||
|
||
namespace tensorrt_llm::batch_manager::kv_cache_manager | ||
{ | ||
|
||
// The TransferManager accelerates transfers to/from the GPU by overlapping HtoD and DtoH transfers, and tracks ongoing | ||
// transfers in order to avoid race conditions. It is functionally equivalent to the prior approach of putting all | ||
// transfers into the forward pass stream. This is only ever used as a component of a KVCacheManager. | ||
class KVCacheTransferManager | ||
{ | ||
public: | ||
explicit KVCacheTransferManager(tr::BufferManager const& bufferManager); | ||
|
||
//! \brief Onboard a block to gpu memory. | ||
void onboard(BlockPtr const& offloadBlock, BlockPtr const& block, std::vector<KVCacheBlockPool> const& pools); | ||
|
||
//! \brief Offload a block to cpu memory. | ||
void offload(BlockPtr const& block, BlockPtr const& offloadBlock, std::vector<KVCacheBlockPool> const& pools); | ||
|
||
//! \brief Synchronize the offload/onboard streams with the bufferManager stream. | ||
void syncTransfers(); | ||
|
||
private: | ||
//! \brief Get pointer to pool specified by cache block. | ||
static tr::ITensor::SharedPtr computeBlockPointer( | ||
BlockPtr const& block, std::vector<KVCacheBlockPool> const& pools, size_t poolIdx); | ||
|
||
//! \brief Copy content of src block to dst. | ||
void copyBlock( | ||
BlockPtr const& src, BlockPtr const& dst, std::vector<KVCacheBlockPool> const& pools, bool isOffload); | ||
|
||
runtime::BufferManager mBufferManager; | ||
runtime::BufferManager mOnboardManager; | ||
runtime::BufferManager mOffloadManager; | ||
|
||
// Track the block ids offloaded in this iteration. | ||
std::unordered_map<int32_t, tr::CudaEvent> mPendingOffloads; | ||
}; | ||
|
||
} // namespace tensorrt_llm::batch_manager::kv_cache_manager |
Oops, something went wrong.