Skip to content

Commit 8f33dd4

Browse files
authored
Merge branch 'dev' into codeql_issues
2 parents 419abe7 + d1306f6 commit 8f33dd4

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/weekly-preview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
branches:
1111
- dev
1212

13+
1314
env:
1415
PYTHON_VER: '3.10'
1516
PYTORCH_VER: '2.8.0'
@@ -66,10 +67,12 @@ jobs:
6667
cache: 'pip'
6768
- name: Install tools
6869
run: |
69-
python -m pip install -U pip build
70+
python -m pip install -U pip build twine
7071
- name: Build distribution
7172
run: |
7273
export HEAD_COMMIT_ID=$(git rev-parse HEAD)
74+
# remove git clone dependencies, see https://github.com/Project-MONAI/MONAI/issues/5882
75+
sed -i /git+/d pyproject.toml
7376
sed -i 's/name\ =\ "monai"$/name\ =\ "monai-weekly"/g' pyproject.toml
7477
echo "__commit_id__ = \"$HEAD_COMMIT_ID\"" >> monai/__init__.py
7578
git diff pyproject.toml monai/__init__.py
@@ -87,11 +90,12 @@ jobs:
8790
ls -lh dist
8891
- name: Test Installation
8992
run: |
93+
twine check --strict dist/*
9094
pip install dist/*.whl
9195
pip list
9296
(cd "$(mktemp -d)" && python -c 'import monai; print(monai.__version__)')
9397
- name: Publish to PyPI
94-
if: github.event_name == 'schedule' # only publish on cron run
98+
if: github.event_name == 'schedule' # only publish on cron run
9599
uses: pypa/gh-action-pypi-publish@release/v1
96100
with:
97101
user: __token__

monai/utils/profiling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def torch_profiler_full(func):
5757

5858
@wraps(func)
5959
def wrapper(*args, **kwargs):
60-
with torch.autograd.profiler.profile() as prof:
60+
with torch.autograd.profiler.profile(use_device="cuda") as prof:
6161
result = func(*args, **kwargs)
6262

6363
print(prof, flush=True)
@@ -76,7 +76,7 @@ def torch_profiler_time_cpu_gpu(func):
7676

7777
@wraps(func)
7878
def wrapper(*args, **kwargs):
79-
with torch.autograd.profiler.profile() as prof:
79+
with torch.autograd.profiler.profile(use_device="cuda") as prof:
8080
result = func(*args, **kwargs)
8181

8282
cpu_time = prof.self_cpu_time_total

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ jsonschema = ["jsonschema"]
125125
lmdb = ["lmdb"]
126126
lpips = ["lpips==0.1.4"]
127127
matplotlib = ["matplotlib>=3.6.3"]
128+
# per #5882 this requirement must be on one line to get removed by sed in weekly-preview.yml
128129
metrics_reloaded = ["MetricsReloaded @ git+https://github.com/Project-MONAI/MetricsReloaded@monai-support"]
129130
mlflow = ["mlflow>=3.15.2"]
130131
nibabel = ["nibabel"]
@@ -147,6 +148,7 @@ pynrrd = ["pynrrd"]
147148
pynvml = ["nvidia-ml-py"]
148149
pyyaml = ["pyyaml"]
149150
requests = ["requests"]
151+
# per #5882 this requirement must be on one line to get removed by sed in weekly-preview.yml
150152
segment_anything = ["segment_anything @ git+https://github.com/facebookresearch/segment-anything.git@6fdee8f2727f4506cfbbe553e23b895e27956588"]
151153
scipy = ["scipy>=1.12.0"]
152154
skimage = ["scikit-image>=0.19.0"]

0 commit comments

Comments
 (0)