Commit e945dae2 authored by Lei Wang's avatar Lei Wang Committed by GitHub
Browse files

[Enhancement] Optimize TileLang Build Process with Dynamic CPU Core Allocation (#152)

- Calculate 75% of available CPU cores for make jobs
- Prevent system unresponsiveness during build
- Dynamically adjust make job count based on system resources
parent 8b9edc3e
...@@ -103,7 +103,14 @@ if [ $? -ne 0 ]; then ...@@ -103,7 +103,14 @@ if [ $? -ne 0 ]; then
fi fi
echo "Building TileLang with make..." echo "Building TileLang with make..."
make -j
# Calculate 75% of available CPU cores
# Other wise, make will use all available cores
# and it may cause the system to be unresponsive
CORES=$(nproc)
MAKE_JOBS=$(( CORES * 75 / 100 ))
make -j${MAKE_JOBS}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error: TileLang build failed." echo "Error: TileLang build failed."
exit 1 exit 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment