Skip to content

Commit fdd7043

Browse files
authored
3rd party: reduce size and make less submodule, faster cicd check. (#87)
* Update build-check-share-runner.yml * ci: adjust code clone for build test. * thridparty: reduce mkl size, remove unused so. * xformers: replace link with source. * cutlass: try use local tar rather than git submodule. * ci: remove shared runner
1 parent a259d62 commit fdd7043

32 files changed

+11268
-77
lines changed

.github/workflows/build-check-share-runner.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: Build Check
1+
name: Build Check with Shared Runner
22
# docker download mirror should setup in self host machine.
33
# the mirror status can be found at : https://status.daocloud.io/status/docker
44
on:
5-
pull_request:
6-
merge_group:
75
workflow_dispatch:
86

97

@@ -17,7 +15,7 @@ jobs:
1715
exclude:
1816
- arch: X64
1917
image: "dev-centos8-arm:v2"
20-
on-runs: ubuntu-22.04
18+
runs-on: ubuntu-22.04
2119
container:
2220
image: dashinfer/${{ matrix.image }}
2321
env:

.github/workflows/build-check.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,27 @@ jobs:
2323
env:
2424
# force use node16 instead of node20
2525
# otherwise it may cause GLIBCXX_2.27 not found
26-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
26+
# ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
2727
ENABLE_CUDA: ${{ matrix.enable_cuda }}
2828
defaults:
2929
run:
3030
shell: bash -l {0}
3131
steps:
3232
- name: Check out code
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
35-
lfs: false
36-
37-
- name: Pull LFS
38-
run: |
39-
git lfs install --force
40-
git lfs pull
41-
42-
- name: Init submodule
43-
run: |
44-
git submodule init
45-
git submodule update
35+
lfs: true
36+
submodules: true
4637

4738
- name: Build tgz package
4839
shell: bash
4940
run: |
41+
git config --global --add safe.directory /__w/dash-infer/dash-infer
5042
source /root/.bashrc
5143
if [ -f "/miniconda/etc/profile.d/conda.sh" ]; then
5244
source /miniconda/etc/profile.d/conda.sh
5345
fi
5446
source activate ds_py
55-
56-
git fetch --tags
57-
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
58-
VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//')
59-
60-
export AS_RELEASE_VERSION=$VERSION_NUMBER
61-
6247
echo "ENABLE_CUDA value: $ENABLE_CUDA"
6348
6449
# export ENABLE_MULTINUMA="ON"
@@ -92,36 +77,23 @@ jobs:
9277
# otherwise it may cause GLIBCXX_2.27 not found
9378
# ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
9479
ENABLE_CUDA: ${{ matrix.enable_cuda }}
80+
BUILD_VERSION: 3.10
9581
steps:
9682
- name: Check out code
97-
uses: actions/checkout@v3
83+
uses: actions/checkout@v4
9884
with:
99-
lfs: false
100-
101-
- name: Pull LFS
102-
run: |
103-
git lfs install --force
104-
git lfs pull
105-
106-
- name: Init submodule
107-
run: |
108-
git submodule init
109-
git submodule update
85+
lfs: true
86+
submodules: true
11087

11188
- name: Build manylinux wheels
11289
shell: bash
11390
run: |
91+
git config --global --add safe.directory /__w/dash-infer/dash-infer
11492
source /root/.bashrc
11593
if [ -f "/miniconda/etc/profile.d/conda.sh" ]; then
11694
source /miniconda/etc/profile.d/conda.sh
11795
fi
11896
119-
git fetch --tags
120-
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
121-
VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//')
122-
123-
export AS_RELEASE_VERSION=$VERSION_NUMBER
124-
12597
echo "ENABLE_CUDA value: $ENABLE_CUDA"
12698
12799
if [[ "${{ matrix.arch }}" == "ARM64" ]]; then
@@ -130,7 +102,7 @@ jobs:
130102
if [ "$ENABLE_CUDA" -eq "1" ];
131103
then
132104
export AS_PLATFORM="cuda"
133-
export AS_CUDA_SM="'70;75;80;86;89;90a'"
105+
export AS_CUDA_SM="'80;90a'"
134106
bash scripts/release/python_manylinux_build_cuda.sh
135107
else
136108
bash scripts/release/python_manylinux_build.sh

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "third_party/from_source/cutlass"]
2-
path = third_party/from_source/cutlass
3-
url = https://github.com/NVIDIA/cutlass.git

cmake/cutlass.cmake

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,58 @@ set(CUTLASS_NVCC_ARCHS ${CMAKE_CUDA_ARCHITECTURES} CACHE STRING "The SM architec
77
set(CUTLASS_INSTALL ${INSTALL_LOCATION}/cutlass/install)
88
message(STATUS "CUTLASS_INSTALL: ${CUTLASS_INSTALL}")
99

10-
message(STATUS "Use cutlass from submodule")
11-
set(CUTLASS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/from_source/cutlass)
10+
# 核心修复方案
11+
set(CUTLASS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/from_source/cutlass)
12+
set(CUTLASS_PACKAGE_FILE ${PROJECT_SOURCE_DIR}/third_party/cutlass_3.5.0.tgz)
13+
14+
# 验证文件存在性
15+
if(NOT EXISTS "${CUTLASS_PACKAGE_FILE}")
16+
message(FATAL_ERROR "Required package not found: ${CUTLASS_PACKAGE_FILE}")
17+
endif()
1218

1319
include(ExternalProject)
1420

1521
ExternalProject_Add(
16-
project_cutlass
17-
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/cutlass
18-
SOURCE_DIR ${CUTLASS_SOURCE_DIR}
19-
CMAKE_GENERATOR "Ninja"
20-
BUILD_COMMAND ${CMAKE_COMMAND} --build . -j32 -v
21-
CMAKE_ARGS
22-
-DCUTLASS_ENABLE_TESTS=${CUTLASS_ENABLE_TESTS}
23-
-DCUTLASS_ENABLE_TOOLS=${CUTLASS_ENABLE_TOOLS}
24-
-DCUTLASS_ENABLE_EXAMPLES=${CUTLASS_ENABLE_EXAMPLES}
25-
-DCUTLASS_NVCC_ARCHS=${CUTLASS_NVCC_ARCHS}
26-
-DCMAKE_INSTALL_PREFIX=${CUTLASS_INSTALL}
22+
project_cutlass
23+
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/cutlass
24+
URL file://${CUTLASS_PACKAGE_FILE}
25+
URL_HASH SHA256=40a3e0eca7d713d6d23db34f6527244f71442149708a87fe736282c952f83d60 # 替换为实际文件哈希
26+
SOURCE_DIR ${CUTLASS_SOURCE_DIR}
27+
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
28+
CMAKE_ARGS
29+
-DCUTLASS_ENABLE_TESTS=${CUTLASS_ENABLE_TESTS}
30+
-DCUTLASS_ENABLE_TOOLS=${CUTLASS_ENABLE_TOOLS}
31+
-DCUTLASS_ENABLE_EXAMPLES=${CUTLASS_ENABLE_EXAMPLES}
32+
-DCUTLASS_NVCC_ARCHS=${CUTLASS_NVCC_ARCHS}
33+
-DCMAKE_INSTALL_PREFIX=${CUTLASS_INSTALL}
34+
-DBUILD_TESTING=OFF
35+
-DBUILD_BENCHMARKS=OFF
36+
-DBUILD_EXAMPLES=OFF
37+
-DBUILD_GEMM_TESTS=OFF
38+
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} -j${NPROC}
39+
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config ${CMAKE_BUILD_TYPE}
40+
UPDATE_COMMAND ""
41+
PATCH_COMMAND ""
2742
)
2843

29-
unset(CUTLASS_ENABLE_TESTS)
30-
unset(CUTLASS_ENABLE_TOOLS)
31-
unset(CUTLASS_ENABLE_EXAMPLES)
32-
unset(CUTLASS_NVCC_ARCHS)
44+
# 依赖关系处理
45+
#add_dependencies(your_project_target project_cutlass)
3346

34-
# ExternalProject_Get_Property(project_cutlass BINARY_DIR)
35-
ExternalProject_Get_Property(project_cutlass SOURCE_DIR)
47+
# 路径配置
3648
ExternalProject_Get_Property(project_cutlass INSTALL_DIR)
37-
set(CUTLASS_INCLUDE_DIR ${SOURCE_DIR}/include)
38-
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CUTLASS_INSTALL}")
49+
set(CUTLASS_INCLUDE_DIR ${INSTALL_DIR}/include)
50+
set(CUTLASS_LIBRARY_DIR ${INSTALL_DIR}/lib)
51+
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${INSTALL_DIR}")
52+
53+
# 验证输出
3954
message(STATUS "CUTLASS_INCLUDE_DIR: ${CUTLASS_INCLUDE_DIR}")
4055
message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
56+
message(STATUS "CUDA_ARCHITECTURES: ${CUTLASS_NVCC_ARCHS}")
4157
message("===========================")
58+
59+
# 清理临时变量
60+
unset(CUTLASS_ENABLE_TESTS)
61+
unset(CUTLASS_ENABLE_TOOLS)
62+
unset(CUTLASS_ENABLE_EXAMPLES)
63+
unset(CUTLASS_NVCC_ARCHS)
64+

csrc/core/kernel/cuda/xformer_mha/debug_utils.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)