Skip to content

Commit 60fb67c

Browse files
committed
refactor: adopt modern InfiniCore execution
1 parent 270feb3 commit 60fb67c

444 files changed

Lines changed: 46002 additions & 29171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ci_config_nvidia.yaml‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
repo:
2+
url: https://github.com/InfiniTensor/InfiniLM.git
3+
branch: main
4+
5+
github:
6+
status_context_prefix: "ci/infinilm"
7+
8+
platforms:
9+
nvidia:
10+
image:
11+
dockerfile: images/nvidia/
12+
build_args:
13+
BASE_IMAGE: nvcr.io/nvidia/pytorch:25.12-py3
14+
CUDA_ARCH: sm_80,sm_86,sm_89,sm_90
15+
APT_MIRROR: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
16+
PIP_INDEX_URL: https://pypi.org/simple
17+
InfiniCore_BRANCH: __Branch_Name__
18+
docker_args:
19+
- "--user=root"
20+
- "--network=host"
21+
- "--privileged"
22+
- "--cap-add=ALL"
23+
- "--pid=host"
24+
- "--ipc=host"
25+
- "--workdir=/workspace"
26+
volumes:
27+
- /data:/data
28+
- /data-aisoft:/data-aisoft
29+
- /data-aisoft/artifacts/CI_nvidia_test/__WORKSPACE__:/artifacts
30+
setup: pip install .[dev] --no-build-isolation
31+
jobs:
32+
gpu_inferencetest:
33+
type: inferencetest
34+
resources:
35+
ngpus: [1, 4]
36+
gpu_style: nvidia
37+
shm_size: 64g
38+
timeout: 3600
39+
stages:
40+
- name: test
41+
run: python InfiniLM/examples/test_infer.py --device nvidia --model=/data-aisoft/mechdancer/models/9g_8b_thinking/
42+
gpu_benchtest:
43+
type: benchtest
44+
resources:
45+
gpu_style: nvidia
46+
shm_size: 64g
47+
timeout: 3600
48+
env:
49+
TEST_PARAM: ['default']
50+
stages:
51+
- name: test
52+
run: python InfiniLM/examples/bench.py --device nvidia --model=/data-aisoft/mechdancer/models/9g_8b_thinking/ --input-len=256,1024 --output-len=256,1024 --batch-size=8 <TEST_PARAM>
53+
gpu_accuracytest:
54+
type: accuracytest
55+
resources:
56+
gpu_style: nvidia
57+
shm_size: 64g
58+
timeout: 3600
59+
env:
60+
TEST_PARAM: ['--bench mmlu']
61+
stages:
62+
- name: test
63+
run: python InfiniLM/test/bench/test_benchmark.py --device nvidia --model /data-aisoft/mechdancer/models/9g_8b_thinking/ --bench mmlu --backend cpp --max-new-tokens 5 --cache-dir /data-aisoft/pepe/datasets/ --split=val <TEST_PARAM>
64+
gpu_servicetest:
65+
type: servicetest
66+
resources:
67+
shm_size: 64g
68+
env:
69+
MODEL_LIST: 9g_8b_thinking
70+
ENGINE: InfiniLM
71+
TEST_PARAM: ['default']
72+
stages:
73+
- name: test
74+
run: python InfiniLM/scripts/test_perf.py --verbose

‎.github/workflows/ci_test.yml‎

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,77 @@
1-
name: CI
2-
3-
on:
4-
pull_request:
5-
push:
6-
paths-ignore:
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
paths-ignore:
77
- "**.md"
88
- "LICENSE"
99
workflow_dispatch:
10-
inputs:
11-
infinicore_branch:
12-
description: "InfiniCore Branch Name"
13-
required: false
14-
default: "main"
15-
type: string
1610

1711
jobs:
18-
check-format:
19-
name: Check Format
12+
host-checks:
13+
name: Host behavior
2014
runs-on: ubuntu-latest
2115
steps:
22-
- name: checkout code
23-
uses: actions/checkout@v4
16+
- uses: actions/checkout@v4
2417
with:
25-
fetch-depth: 0
26-
27-
- name: Install format dependencies
18+
submodules: recursive
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
- name: Install host test dependency
23+
run: python -m pip install numpy==2.3.5
24+
- name: Run selected host checks
2825
run: |
29-
python -m pip install clang-format==21.1.8 black ruff==0.15.20 colorama
26+
python -m unittest discover -s test/scripts -p "test_base_config_device_detection.py" -v
3027
31-
- name: Check Format
32-
run: |
33-
if [ "${{ github.event_name }}" = "pull_request" ]; then
34-
python3 scripts/format.py --ref "origin/${{ github.base_ref }}" --check
35-
elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
36-
python3 scripts/format.py --ref "${{ github.event.before }}" --check
37-
else
28+
check-format:
29+
name: Check Format
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Install format dependencies
38+
run: |
39+
python -m pip install clang-format==21.1.8 black ruff==0.15.20 colorama
40+
41+
- name: Check Format
42+
run: |
43+
if [ "${{ github.event_name }}" = "pull_request" ]; then
44+
python3 scripts/format.py --ref "origin/${{ github.base_ref }}" --check
45+
elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
46+
python3 scripts/format.py --ref "${{ github.event.before }}" --check
47+
else
3848
python3 scripts/format.py --ref origin/main --check
3949
fi
4050
51+
dependency-identity:
52+
if: github.event_name == 'workflow_dispatch'
53+
runs-on: ubuntu-latest
54+
outputs:
55+
infinicore_sha: ${{ steps.core.outputs.sha }}
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
submodules: recursive
60+
- id: core
61+
shell: bash
62+
run: |
63+
expected=$(git ls-tree HEAD third_party/InfiniCore | awk '$1==160000 {print $3}')
64+
actual=$(git -C third_party/InfiniCore rev-parse HEAD)
65+
test -n "$expected" && test "$actual" = "$expected"
66+
git submodule status --recursive | awk '/^[+-U]/ {bad=1} END {exit bad}'
67+
printf 'sha=%s\n' "$actual" >> "$GITHUB_OUTPUT"
68+
4169
ci:
4270
if: github.event_name == 'workflow_dispatch'
43-
needs: check-format
44-
uses: InfiniTensor/ci/.github/workflows/infinilm-ci.yml@infiniCore_ci
71+
needs: [check-format, dependency-identity]
72+
uses: InfiniTensor/ci/.github/workflows/infinilm-ci.yml@refactor/adopt-modern-infini-stack
4573
with:
46-
config_path: .github/ci_config.yaml
47-
ci_ref: infiniCore_ci
48-
infinicore_branch: ${{ github.event.inputs.infinicore_branch || 'main' }}
74+
config_path: .github/ci_config_nvidia.yaml
75+
ci_ref: refactor/adopt-modern-infini-stack
76+
infinicore_branch: ${{ needs.dependency-identity.outputs.infinicore_sha }}
4977
secrets: inherit

‎.gitmodules‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "third_party/json"]
55
path = third_party/json
66
url = https://github.com/nlohmann/json.git
7+
[submodule "third_party/InfiniCore"]
8+
path = third_party/InfiniCore
9+
url = https://github.com/InfiniTensor/InfiniCore.git

‎CONTRIBUTING.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,22 @@ Existing branch names may use the legacy format `issue/###`, followed by a suffi
5858

5959
# Development Guide
6060

61-
Refer to [ReadMe](README.md) and [Adapt New Models](MODELS.md)
61+
Refer to [ReadMe](README.md) and [Adapt New Models](MODELS.md).
62+
63+
Platform configuration and stack-builder tests belong to
64+
[InfiniCore](third_party/InfiniCore/README.md). Check its pinned build commands
65+
without creating build output:
66+
67+
```shell
68+
python third_party/InfiniCore/scripts/build.py --dry-run --jobs 1 --cuda-arch sm_80
69+
```
70+
71+
Build Core first and set `INFINI_ROOT` before configuring or installing LM
72+
from source; use the same ABI/profile as that prefix.
73+
74+
Native stack changes must be validated in the owning component repository
75+
first. After validation, update the corresponding submodule pin in InfiniCore
76+
before validating InfiniLM.
6277

6378
## Troubleshooting
6479

0 commit comments

Comments
 (0)