Skip to content

Commit 58642b6

Browse files
authored
Merge branch 'main' into eden_llama
2 parents 4d7e262 + e213d40 commit 58642b6

9 files changed

Lines changed: 184 additions & 55 deletions

File tree

.github/workflows/unit-tests-framework.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ jobs:
3030
fetch-depth: 0
3131
submodules: "recursive"
3232

33+
- name: Get merge-base commit
34+
id: merge-base
35+
run: |
36+
# Get the merge-base between current branch and main
37+
MERGE_BASE=$(git merge-base HEAD origin/main)
38+
echo "merge-base=$MERGE_BASE" >> $GITHUB_OUTPUT
39+
echo "Merge-base commit: $MERGE_BASE"
40+
3341
- uses: step-security/changed-files@v46
3442
id: changed-files
3543
with:
36-
base_sha: main
44+
base_sha: ${{ steps.merge-base.outputs.merge-base }}
3745
files: |
3846
**
3947
!models/**
@@ -42,6 +50,7 @@ jobs:
4250
!.github/**
4351
!.gitignore
4452
!.devcontainer/**
53+
!ci/scripts/recipes_local_test.py
4554
.github/workflows/unit-tests-framework.yml
4655
4756
- name: Show output
@@ -239,8 +248,6 @@ jobs:
239248
- name: Run notebook tests
240249
env:
241250
BIONEMO_DATA_SOURCE: ngc
242-
# this variable should be used in the notebooks to run a subset of the model layers or a smaller model/dataset
243-
FAST_CI_MODE: true
244251
run: |
245252
chmod +x ./ci/scripts/run_pytest_notebooks.sh
246253
./ci/scripts/run_pytest_notebooks.sh

.github/workflows/unit-tests-recipes.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,21 @@ jobs:
3535
with:
3636
fetch-depth: 0
3737

38+
- name: Get merge-base commit
39+
id: merge-base
40+
run: |
41+
# Get the merge-base between current branch and main
42+
MERGE_BASE=$(git merge-base HEAD origin/main)
43+
echo "merge-base=$MERGE_BASE" >> $GITHUB_OUTPUT
44+
echo "Merge-base commit: $MERGE_BASE"
45+
3846
- name: Get changed files
3947
id: changed-files
4048
uses: step-security/changed-files@v46
4149
with:
4250
json: true
4351
matrix: true
44-
base_sha: main
52+
base_sha: ${{ steps.merge-base.outputs.merge-base }}
4553
dir_names: true
4654
dir_names_max_depth: 2
4755
files: |
@@ -84,21 +92,35 @@ jobs:
8492
# Assign Docker images to the selected directories
8593
# Currently, AMPLIFY is the only folder that needs a custom base image, since we have to support both TE and
8694
# xformers-based models for golden value testing. The rest of the models use the default pytorch image.
95+
96+
# This uses a squashed version of the pytorch:25.06-py3 image, generated with `docker-squash
97+
# nvcr.io/nvidia/pytorch:25.06-py3 -t svcbionemo023/bionemo-framework:pytorch25.06-py3-squashed --output
98+
# type=registry,compression=zstd,force-compression=true,oci-mediatypes=true,compression-level=15` and pushed
99+
# to the dockerhub registry. Our github actions are able to cache image pulls from dockerhub but not nvcr, so
100+
# hopefully this cuts down slightly on CI time at the expense of having a slightly in-directed image location.
101+
87102
DIRS_WITH_IMAGES=$(echo "$DIRS" | jq -c '
88103
map({
89104
dir: .,
90105
image: (
91106
if . == "models/amplify" then
92107
"svcbionemo023/bionemo-framework:amplify-model-devcontainer-082025"
93108
else
94-
"nvcr.io/nvidia/pytorch:25.06-py3"
109+
"svcbionemo023/bionemo-framework:pytorch25.06-py3-squashed-zstd"
95110
end
96111
)
97112
})
98113
')
99114
echo "dirs=$DIRS_WITH_IMAGES" >> $GITHUB_OUTPUT
115+
100116
- name: Show output
101117
run: |
118+
echo "=== Changed Files Analysis ==="
119+
echo "Current branch: ${{ github.ref_name }}"
120+
echo "Merge-base commit: ${{ steps.merge-base.outputs.merge-base }}"
121+
echo "Changed files compared to merge-base:"
122+
echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq -r '.[]' | sed 's/^/ - /'
123+
echo "Total changed files: $(echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq '. | length')"
102124
echo '${{ toJSON(steps.changed-files.outputs) }}'
103125
echo '${{ toJSON(steps.set-dirs.outputs) }}'
104126
shell: bash
@@ -115,8 +137,12 @@ jobs:
115137
fail-fast: false
116138

117139
steps:
140+
141+
- name: Show GPU info
142+
run: nvidia-smi
118143
- name: Setup proxy cache
119144
uses: nv-gha-runners/setup-proxy-cache@main
145+
120146
- name: Checkout repository
121147
uses: actions/checkout@v4
122148
with:
@@ -125,7 +151,6 @@ jobs:
125151

126152
- name: Install dependencies
127153
working-directory: ${{ matrix.recipe.dir }}
128-
#
129154
run: |
130155
if [ -f pyproject.toml ] || [ -f setup.py ]; then
131156
PIP_CONSTRAINT= pip install -e .

3rdparty/NeMo

Submodule NeMo updated 63 files

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ apt-get install -qyy \
4949
curl \
5050
pre-commit \
5151
sudo \
52+
emacs-nox \
5253
gnupg \
5354
unzip \
5455
libsqlite3-dev
Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,39 @@
2323
from pathlib import Path
2424
from typing import List, Optional
2525

26+
from platformdirs import user_cache_dir
27+
28+
29+
PIP_CACHE_DIR = user_cache_dir(appname="bionemo-pip-cache", appauthor="nvidia")
2630

2731
logger = logging.getLogger(__name__)
2832
logger.setLevel(logging.DEBUG)
2933

3034
DOCKER_RUN_ARGS = [
3135
"--rm",
32-
"-it",
3336
"--gpus",
3437
"all",
3538
"--ipc=host",
3639
"--ulimit",
3740
"memlock=-1",
3841
"--ulimit",
3942
"stack=67108864",
43+
"-v",
44+
f"{PIP_CACHE_DIR}:/workspace/.cache/pip",
4045
]
4146

4247
CUSTOM_CONTAINERS = {
4348
"models/amplify": "svcbionemo023/bionemo-framework:amplify-model-devcontainer-082025",
4449
}
45-
DEFAULT_CONTAINER = "nvcr.io/nvidia/pytorch:25.06-py3"
50+
51+
# DEFAULT_CONTAINER = "nvcr.io/nvidia/pytorch:25.06-py3"
52+
53+
# This is a squashed version of the pytorch:25.06-py3 image, generated with
54+
# docker-squash nvcr.io/nvidia/pytorch:25.06-py3 -t svcbionemo023/bionemo-framework:pytorch25.06-py3-squashed
55+
# --output type=registry,compression=zstd,force-compression=true,oci-mediatypes=true,compression-level=15
56+
# and pushed to the dockerhub registry. Our github actions are able to cache image pulls from dockerhub but not nvcr, so
57+
# hopefully this cuts down slightly on CI time at the expense of having a slightly in-directed image location.
58+
DEFAULT_CONTAINER = "svcbionemo023/bionemo-framework:pytorch25.06-py3-squashed"
4659

4760

4861
def get_git_root() -> str:
@@ -89,24 +102,26 @@ def run_tests_in_docker(work_dir: str) -> bool:
89102
install_and_test_script = textwrap.dedent("""
90103
set -e # Exit on any error
91104
92-
echo "Checking for dependency files..."
105+
# Ensure image-embedded constraints do not leak into local recipe installs
106+
unset PIP_CONSTRAINT || true
93107
108+
echo "Checking for dependency files..."
94109
# Install dependencies based on available files
95110
if [ -f pyproject.toml ] || [ -f setup.py ]; then
96111
echo "Installing package in editable mode..."
97-
PIP_CONSTRAINT= pip install -e .
112+
PIP_CACHE_DIR=/workspace/.cache/pip pip install -e .
98113
echo "Installed package as editable package"
99114
elif [ -f requirements.txt ]; then
100115
echo "Installing from requirements.txt..."
101-
PIP_CONSTRAINT= pip install -r requirements.txt
116+
PIP_CACHE_DIR=/workspace/.cache/pip pip install -r requirements.txt
102117
echo "Installed from requirements.txt"
103118
else
104119
echo "No pyproject.toml, setup.py, or requirements.txt found"
105120
exit 1
106121
fi
107122
108123
echo "Running tests..."
109-
pytest -v .
124+
python -m pytest -v .
110125
""")
111126

112127
relative_path = Path(work_dir).relative_to(git_root).as_posix()
@@ -166,6 +181,8 @@ def main():
166181
if args.debug:
167182
logging.getLogger().setLevel(logging.DEBUG)
168183

184+
logger.info(f"Caching pip installations to: {PIP_CACHE_DIR}")
185+
169186
# Get directories to test
170187
test_dirs = get_test_directories(args.directories)
171188

ci/scripts/run_pytest_notebooks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
# Enable strict mode with better error handling
2020
set -euox pipefail
2121

22-
pytest -v --nbval-lax -x -p no:python docs/ sub-packages/
22+
FAST_CI_MODE=true pytest -v --nbval-lax -x -p no:python docs/ sub-packages/

models/amplify/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ dependencies = [
1919
"nvidia_resiliency_ext",
2020
"omegaconf",
2121
"pytest",
22-
"torch",
23-
# "transformer_engine[pytorch]",
22+
"torch==2.6.0a0+ecf3bae40a.nv25.01",
23+
"transformer_engine[pytorch]",
2424
"transformers",
2525
"xformers",
2626
]

sub-packages/bionemo-evo2/src/bionemo/evo2/run/infer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,12 @@ def parse_args():
8686
)
8787
ap.add_argument(
8888
"--fp8",
89-
type=bool,
9089
action="store_true",
9190
default=False,
9291
help="Whether to use vortex style FP8. Defaults to False.",
9392
)
9493
ap.add_argument(
9594
"--flash-decode",
96-
type=bool,
9795
action="store_true",
9896
default=False,
9997
help="Whether to use flash decode. Defaults to True.",

0 commit comments

Comments
 (0)