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

[Enhancement] Optimize CMake build process with dynamic job count calculation (#183)

* Optimize CMake build process with dynamic job count calculation

- Modify build_csrc function to use 90% of available CPU cores
- Ensure at least one job is used during compilation
- Improve build performance by dynamically adjusting parallel job count

* Optimize build_csrc function with multiprocessing module

- Replace os.cpu_count() with multiprocessing.cpu_count()
- Maintain existing 90% CPU utilization logic
- Improve CPU core count calculation for build process
parent 6891d3ec
......@@ -212,7 +212,7 @@ def build_csrc(llvm_config_path):
# Run CMake and make
try:
subprocess.check_call(["cmake", ".."])
num_jobs = multiprocessing.cpu_count()
num_jobs = max(1, int(multiprocessing.cpu_count() * 0.9))
subprocess.check_call(["make", f"-j{num_jobs}"])
except subprocess.CalledProcessError as error:
raise RuntimeError("Failed to build TileLang C Source") from error
......
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