Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .azure-pipelines/ansible-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ steps:
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Export path
- script: |
python3 -m pip install .[test]
set -e
python3 -m pip install --upgrade setuptools==65.7
python3 -m pip install -c requirements/ansible.txt .[test]
make postinstall
displayName: Install Ansible dependencies
- script: |
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/cpu-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ steps:
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Export path
- script: |
set -e
if python3 -c "import sys; exit(0 if sys.version_info < (3, 11) else 1)"; then
python3 -m pip install --upgrade setuptools==65.7
fi
python3 -m pip install --no-cache-dir .[test,cpuworker]
python3 -m pip install --no-cache-dir -c requirements/ansible.txt .[test,cpuworker]
Comment thread
gusui-msft marked this conversation as resolved.
Resolved
displayName: Install dependencies
- script: |
make postinstall
displayName: Install Ansible collections
retryCountOnTaskFailure: 2
- script: |
python3 setup.py lint
displayName: Run code lint
Expand Down
3 changes: 1 addition & 2 deletions .azure-pipelines/cuda-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ steps:
apt-get install -y -q \
ffmpeg libavcodec-dev libavformat-dev libavutil-dev libboost-program-options-dev libswresample-dev"
python3 -m pip install --upgrade setuptools==65.7
python3 -m pip install .[test,nvworker]
python3 -m pip install -c requirements/ansible.txt .[test,nvworker]
displayName: Install dependencies
- script: |
make postinstall
displayName: Install Ansible collections
retryCountOnTaskFailure: 2
- script: |
python3 setup.py lint
displayName: Run code lint
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/post-create-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -e
export PATH=${HOME}/.local/bin:${PATH}

# install python packages
pip install .[develop,cpuworker] --user --no-cache-dir --progress-bar=off --use-feature=in-tree-build
pip install -c requirements/ansible.txt .[develop,cpuworker] --user --no-cache-dir --progress-bar=off --use-feature=in-tree-build
make postinstall
pre-commit install --install-hooks

# install nodejs packages
Expand Down
22 changes: 17 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@ thirdparty:
cd ./third_party/ && make all

postinstall:
ifeq ($(shell which ansible-galaxy),)
$(error 'Cannot find ansible-galaxy')
else
ansible-galaxy collection install ansible.posix ansible.utils community.crypto
endif
@command -v ansible-galaxy >/dev/null || { echo "Cannot find ansible-galaxy" >&2; exit 1; }
@version=$$(ansible-galaxy --version 2>/dev/null | sed -n '1p') || exit $$?; \
case "$$version" in \
"") echo "Cannot determine ansible-galaxy version" >&2; exit 1 ;; \
*" 2.9."* | *" 2.10."* | *"[core 2.1"[1-5]"."*) \
collections="ansible.posix:1.5.4 ansible.utils:2.12.0 community.crypto:2.16.0" ;; \
*) \
collections="ansible.posix:2.2.2 ansible.utils:6.1.1 community.crypto:3.5.1" ;; \
esac; \
for attempt in 1 2 3; do \
timeout -k 30 300 ansible-galaxy collection install $$collections && exit 0; \
status=$$?; \
echo "Ansible collections: attempt $$attempt/3 failed (exit $$status)." >&2; \
if [ $$attempt -eq 3 ]; then exit $$status; fi; \
echo "Retrying in $$((attempt * 10)) seconds." >&2; \
sleep $$((attempt * 10)) || exit $$?; \
done
8 changes: 6 additions & 2 deletions dockerfile/cuda11.1.1.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,13 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
rustup self uninstall -y && \
rm -rf /root/.cargo /root/.rustup

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall

ADD . .
RUN python3 -m pip install --upgrade setuptools==65.7 importlib_metadata==6.8.0 && \
python3 -m pip install --no-cache-dir .[nvworker] && \
python3 -m pip install --no-cache-dir -c requirements/ansible.txt .[nvworker] && \
make cppbuild && \
make postinstall && \
rm -rf .git
8 changes: 6 additions & 2 deletions dockerfile/cuda12.9.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ WORKDIR ${SB_HOME}
ADD third_party third_party
RUN make -C third_party cuda_with_msccl

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall

ADD . .
RUN python3 -m pip install --upgrade setuptools==78.1.0 && \
python3 -m pip install --no-cache-dir .[nvworker] && \
python3 -m pip install --no-cache-dir -c requirements/ansible.txt .[nvworker] && \
make cppbuild && \
make postinstall && \
rm -rf .git
8 changes: 6 additions & 2 deletions dockerfile/cuda13.0.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,13 @@ WORKDIR ${SB_HOME}
ADD third_party third_party
RUN make -C third_party cuda

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall

ADD . .
RUN python3 -m pip install --upgrade setuptools==78.1.0 && \
python3 -m pip install --no-cache-dir .[nvworker] && \
python3 -m pip install --no-cache-dir -c requirements/ansible.txt .[nvworker] && \
make cppbuild && \
make postinstall && \
rm -rf .git
8 changes: 6 additions & 2 deletions dockerfile/cuda13.4.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,13 @@ RUN f=${SB_MICRO_PATH}/bin/streamOlympus; \
if printf '%s\n' "$output" | grep -Eq 'not found|undefined symbol'; then exit 1; fi; \
fi

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall
Comment thread
gusui-msft marked this conversation as resolved.
Resolved

ADD . .
RUN python3 -m pip install --upgrade setuptools==78.1.0 && \
python3 -m pip install --no-cache-dir .[nvworker] && \
python3 -m pip install --no-cache-dir -c requirements/ansible.txt .[nvworker] && \
make cppbuild && \
make postinstall && \
rm -rf .git
8 changes: 6 additions & 2 deletions dockerfile/cuda13.5.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ ADD dockerfile/etc /opt/microsoft/

WORKDIR ${SB_HOME}

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall

# Copy everything before release clones so legacy submodules cannot overlay them later.
ADD . .
# Build the CUDA targets (the `cuda` aggregate; MSCCL is not included). mpicc comes from the
Expand All @@ -206,7 +211,6 @@ RUN f=${SB_MICRO_PATH}/bin/streamOlympus; \

# Keep the base image's setuptools version for NVIDIA ModelOpt compatibility.
RUN python3 -m pip install --upgrade setuptools==81.0.0 && \
python3 -m pip install --no-cache-dir .[nvworker] && \
python3 -m pip install --no-cache-dir -c requirements/ansible.txt .[nvworker] && \
make cppbuild && \
make postinstall && \
rm -rf .git
8 changes: 6 additions & 2 deletions dockerfile/rocm6.3.x.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,14 @@ ADD third_party third_party

RUN make RCCL_HOME=/opt/rocm ROCBLAS_BRANCH=release-staging/rocm-rel-6.3 HIPBLASLT_BRANCH=release-staging/rocm-rel-6.3 ROCM_VER=rocm-5.5.0 -C third_party rocm -o cpu_hpl -o cpu_stream -o megatron_lm -o rocm_megatron_lm

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall

ADD . .
ENV USE_HIP_DATATYPE=1
ENV USE_HIPBLAS_COMPUTETYPE=1
RUN python3 -m pip install --no-build-isolation .[amdworker] && \
RUN python3 -m pip install --no-build-isolation -c requirements/ansible.txt .[amdworker] && \
CXX=/opt/rocm/bin/hipcc make cppbuild && \
make postinstall && \
rm -rf .git
10 changes: 7 additions & 3 deletions dockerfile/rocm6.4.x.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,18 @@ RUN transformer_engine_architectures=$(printf '%s' "${AMDGPU_TARGETS}" | tr -s '
python3 setup.py install
RUN python3 -c "import transformer_engine.pytorch; print('TE installed successfully')"

COPY requirements/ansible.txt requirements/ansible.txt
COPY Makefile ./
RUN python3 -m pip install --no-cache-dir -r requirements/ansible.txt && \
make postinstall

ADD . .
ENV USE_HIP_DATATYPE=1
ENV USE_HIPBLAS_COMPUTETYPE=1
RUN python3 -m pip install .[amdworker] && \
RUN python3 -m pip install -c requirements/ansible.txt .[amdworker] && \
CXX=/opt/rocm/bin/hipcc make cppbuild && \
make postinstall && \
rm -rf .git

# Fix stale hypothesis plugin from base image (imports removed pkg_resources)
# and add test dependencies missing from the base image.
RUN python3 -m pip install --upgrade hypothesis setuptools pytest-timeout vcrpy
RUN python3 -m pip install -c requirements/ansible.txt --upgrade hypothesis setuptools pytest-timeout vcrpy
17 changes: 16 additions & 1 deletion docs/developer-guides/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,24 @@ Follow [System Requirements](../getting-started/installation.mdx).
git clone --recurse-submodules -j8 https://github.com/microsoft/superbenchmark
cd superbenchmark

python3 -m pip install -e .[develop]
python3 -m pip install -c requirements/ansible.txt -e .[develop]
make postinstall
```

Use a clean Python environment without the bundled `ansible` distribution.
The Linux control environment needs GNU `timeout`, `openssh-client` and `rsync`.

### Ansible Dependencies

`requirements/ansible.txt` pins the Ansible engine, `ansible-runner`, and
`Jinja2` for each supported Python runtime, while `Makefile` (`make postinstall`)
selects the matching legacy or modern collection pins from the active
`ansible-galaxy` runtime with bounded retries. Active GPU Dockerfiles install
this layer before copying the repository so source-only edits reuse the cached
layer. When updating versions, keep `requirements/ansible.txt`, `setup.py`, and
`Makefile` aligned and run `python3 -m pytest -q tests/runner/test_ansible.py`
across legacy and modern Python runtimes.

## Lint and Test

Format code using yapf.
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ You should checkout corresponding tag to use release version, for example,
git clone https://github.com/microsoft/superbenchmark
cd superbenchmark

python3 -m pip install .
python3 -m pip install -c requirements/ansible.txt .
make postinstall
```

Expand Down
8 changes: 8 additions & 0 deletions requirements/ansible.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

ansible-base==2.10.17; python_version < "3.11"
ansible-core==2.19.15; python_version >= "3.11"
ansible-runner==2.3.1; python_version < "3.11"
ansible-runner==2.4.3; python_version >= "3.11"
Jinja2==3.1.6
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ def run(self):
'vcs_versioning; python_version>="3.10"',
],
install_requires=[
'ansible;os_name=="posix" and python_version>"3.10"',
'ansible_base>=2.10.9;os_name=="posix" and python_version<="3.10"',
'ansible_runner>=2.0.0rc1, <2.3.2;python_version<="3.10"',
'ansible_runner;python_version>"3.10"',
'ansible-core>=2.19,<2.23;os_name=="posix" and python_version>="3.11"',
Comment thread
gusui-msft marked this conversation as resolved.
Resolved
'ansible_base>=2.10.17,<2.11;os_name=="posix" and python_version<"3.11"',
'ansible_runner>=2.0.0rc1, <2.3.2;python_version<"3.11"',
'ansible_runner>=2.4.3,<2.5;python_version>="3.11"',
'colorlog>=6.7.0',
'importlib_metadata',
'jinja2>=2.10.1',
Expand Down
Loading
Loading