Skip to content

Commit 3f61c50

Browse files
minosfuturediegocastanibm
authored andcommitted
[Misc] Use dracut on CentOS and skip clone if repo exists for EP kernel installation (vllm-project#21635)
Signed-off-by: Ming Yang <[email protected]> Signed-off-by: Diego-Castan <[email protected]>
1 parent 6db6f2b commit 3f61c50

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

tools/ep_kernels/configure_system_drivers.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ set -ex
22

33
# turn on IBGDA
44
echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1;"' | tee -a /etc/modprobe.d/nvidia.conf
5-
update-initramfs -u
5+
6+
if command -v update-initramfs &> /dev/null; then
7+
# for Debian/Ubuntu
8+
sudo update-initramfs -u
9+
elif command -v dracut &> /dev/null; then
10+
# for Fedora/CentOS
11+
sudo dracut --force
12+
else
13+
echo "No supported initramfs update tool found."
14+
exit 1
15+
fi
616

717
echo "Please reboot the system to apply the changes"

tools/ep_kernels/install_python_libraries.sh

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,45 @@ popd
5353

5454
export CMAKE_PREFIX_PATH=$WORKSPACE/nvshmem_install:$CMAKE_PREFIX_PATH
5555

56+
is_git_dirty() {
57+
local dir=$1
58+
pushd "$dir" > /dev/null
59+
60+
if [ -d ".git" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; then
61+
popd > /dev/null
62+
return 0 # dirty (true)
63+
else
64+
popd > /dev/null
65+
return 1 # clean (false)
66+
fi
67+
}
68+
69+
# Function to handle git repository cloning with dirty/incomplete checks
70+
clone_repo() {
71+
local repo_url=$1
72+
local dir_name=$2
73+
local key_file=$3
74+
75+
if [ -d "$dir_name" ]; then
76+
# Check if directory has uncommitted changes (dirty)
77+
if is_git_dirty "$dir_name"; then
78+
echo "$dir_name directory is dirty, skipping clone"
79+
# Check if clone failed (directory exists but not a valid git repo or missing key files)
80+
elif [ ! -d "$dir_name/.git" ] || [ ! -f "$dir_name/$key_file" ]; then
81+
echo "$dir_name directory exists but clone appears incomplete, cleaning up and re-cloning"
82+
rm -rf "$dir_name"
83+
git clone "$repo_url"
84+
else
85+
echo "$dir_name directory exists and appears complete; manually update if needed"
86+
fi
87+
else
88+
git clone "$repo_url"
89+
fi
90+
}
91+
5692
# build and install pplx, require pytorch installed
5793
pushd $WORKSPACE
58-
git clone https://github.com/ppl-ai/pplx-kernels
94+
clone_repo "https://github.com/ppl-ai/pplx-kernels" "pplx-kernels" "setup.py"
5995
cd pplx-kernels
6096
# see https://github.com/pypa/pip/issues/9955#issuecomment-838065925
6197
# PIP_NO_BUILD_ISOLATION=0 disables build isolation
@@ -64,7 +100,7 @@ popd
64100

65101
# build and install deepep, require pytorch installed
66102
pushd $WORKSPACE
67-
git clone https://github.com/deepseek-ai/DeepEP
103+
clone_repo "https://github.com/deepseek-ai/DeepEP" "DeepEP" "setup.py"
68104
cd DeepEP
69105
export NVSHMEM_DIR=$WORKSPACE/nvshmem_install
70106
PIP_NO_BUILD_ISOLATION=0 pip install -vvv -e .

0 commit comments

Comments
 (0)