-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Attempt to remove AWS S3 flaky cache for sccache #2953
Conversation
…n rustc_wrapper is present
RUN export CMAKE_C_COMPILER_LAUNCHER=sccache && \ | ||
export CMAKE_CXX_COMPILER_LAUNCHER=sccache && \ | ||
export CMAKE_CUDA_COMPILER_LAUNCHER=sccache && \ | ||
mkdir $TGI_INSTALL_PREFIX && mkdir "$TGI_INSTALL_PREFIX/include" && mkdir "$TGI_INSTALL_PREFIX/lib" && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care about these environment variables not being persisted
if (NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER) | ||
find_program(CCACHE_EXECUTABLE "ccache") | ||
if (CCACHE_EXECUTABLE) | ||
message(STATUS "Using ccache") | ||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}") | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}") | ||
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}") | ||
endif () | ||
else () | ||
message(STATUS "Using user specified cmake cxx compiler launcher: ${CMAKE_CXX_COMPILER_LAUNCHER}") | ||
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}") | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}") | ||
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}") | ||
endif () | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a purely manual thing to specify a compiler launcher, remove any way to look smart here :D
@@ -14,7 +14,7 @@ const TENSORRT_ROOT_DIR: Option<&str> = option_env!("TENSORRT_ROOT_DIR"); | |||
const NCCL_ROOT_DIR: Option<&str> = option_env!("NCCL_ROOT_DIR"); | |||
|
|||
const IS_GHA_BUILD: LazyLock<bool> = LazyLock::new(|| { | |||
option_env!("IS_GHA_BUILD").map_or(false, |value| match value.to_lowercase().as_str() { | |||
option_env!("SCCACHE_GHA_ENABLED").map_or(false, |value| match value.to_lowercase().as_str() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are setting this variable to ON
to make sccache outputs to GHA caching layer.
So it should be true
in GHA contexts and false
otherwise
- name: Inject required variables for sccache to interact with Github Actions Cache | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new step is required to expose the cache parameters inside the job so we can use in building step for TRTLLM forwarding to sccache
cache-from: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=min | ||
cache-to: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=min | ||
cache-from: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=max | ||
cache-to: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Letś try max. I think we reverted to min
because it was uploading way too many layers, leading to actual degradation in runtime.
Leverage GHA cache rather than S3