Skip to content

Commit 463cd22

Browse files
authored
hotfix: change MAX_JOBS in aot ci (#1621)
<!-- .github/pull_request_template.md --> ## πŸ“Œ Description aarch64 instance tend to use more memory than x86_64, hardcode MAX_JOBS to half of x86_64's ## πŸ” Related Issues #1612 ## πŸš€ Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### βœ… Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [ ] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## πŸ§ͺ Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. -->
1 parent f131f3d commit 463cd22

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

β€Žscripts/task_test_aot_build_import.shβ€Ž

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,29 @@
33
set -eo pipefail
44
set -x
55

6-
# MAX_JOBS = min(nproc, max(1, MemAvailable_GB/4))
6+
# Set MAX_JOBS based on architecture and available memory
7+
ARCH=$(uname -m)
78
MEM_AVAILABLE_GB=$(free -g | awk '/^Mem:/ {print $7}')
89
NPROC=$(nproc)
9-
MAX_JOBS=$(( MEM_AVAILABLE_GB / 4 ))
10-
if (( MAX_JOBS < 1 )); then
11-
MAX_JOBS=1
12-
elif (( NPROC < MAX_JOBS )); then
13-
MAX_JOBS=$NPROC
10+
11+
# Calculate base MAX_JOBS based on memory (4GB per job)
12+
BASE_MAX_JOBS=$(( MEM_AVAILABLE_GB / 4 ))
13+
if (( BASE_MAX_JOBS < 1 )); then
14+
BASE_MAX_JOBS=1
15+
elif (( NPROC < BASE_MAX_JOBS )); then
16+
BASE_MAX_JOBS=$NPROC
17+
fi
18+
19+
# Apply architecture-specific scaling
20+
if [[ "$ARCH" == "aarch64" ]]; then
21+
# Use half the jobs on aarch64 compared to x86_64
22+
MAX_JOBS=$(( BASE_MAX_JOBS / 2 ))
23+
if (( MAX_JOBS < 1 )); then
24+
MAX_JOBS=1
25+
fi
26+
else
27+
# x86_64, amd64, and other architectures use full capacity
28+
MAX_JOBS=$BASE_MAX_JOBS
1429
fi
1530

1631
: ${CUDA_VISIBLE_DEVICES:=""}

0 commit comments

Comments
Β (0)