diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 7b5dd442aa..09ee4fd3ee 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -10,6 +10,7 @@ on: branches: - dev + env: PYTHON_VER: '3.10' PYTORCH_VER: '2.8.0' @@ -66,10 +67,12 @@ jobs: cache: 'pip' - name: Install tools run: | - python -m pip install -U pip build + python -m pip install -U pip build twine - name: Build distribution run: | export HEAD_COMMIT_ID=$(git rev-parse HEAD) + # remove git clone dependencies, see https://github.com/Project-MONAI/MONAI/issues/5882 + sed -i /git+/d pyproject.toml sed -i 's/name\ =\ "monai"$/name\ =\ "monai-weekly"/g' pyproject.toml echo "__commit_id__ = \"$HEAD_COMMIT_ID\"" >> monai/__init__.py git diff pyproject.toml monai/__init__.py @@ -87,11 +90,12 @@ jobs: ls -lh dist - name: Test Installation run: | + twine check --strict dist/* pip install dist/*.whl pip list (cd "$(mktemp -d)" && python -c 'import monai; print(monai.__version__)') - name: Publish to PyPI - if: github.event_name == 'schedule' # only publish on cron run + if: github.event_name == 'schedule' # only publish on cron run uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ diff --git a/monai/utils/profiling.py b/monai/utils/profiling.py index e325953298..d26da6e8ce 100644 --- a/monai/utils/profiling.py +++ b/monai/utils/profiling.py @@ -57,7 +57,7 @@ def torch_profiler_full(func): @wraps(func) def wrapper(*args, **kwargs): - with torch.autograd.profiler.profile() as prof: + with torch.autograd.profiler.profile(use_device="cuda") as prof: result = func(*args, **kwargs) print(prof, flush=True) @@ -76,7 +76,7 @@ def torch_profiler_time_cpu_gpu(func): @wraps(func) def wrapper(*args, **kwargs): - with torch.autograd.profiler.profile() as prof: + with torch.autograd.profiler.profile(use_device="cuda") as prof: result = func(*args, **kwargs) cpu_time = prof.self_cpu_time_total diff --git a/pyproject.toml b/pyproject.toml index 684d905002..c90656405b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,6 +125,7 @@ jsonschema = ["jsonschema"] lmdb = ["lmdb"] lpips = ["lpips==0.1.4"] matplotlib = ["matplotlib>=3.6.3"] +# per #5882 this requirement must be on one line to get removed by sed in weekly-preview.yml metrics_reloaded = ["MetricsReloaded @ git+https://github.com/Project-MONAI/MetricsReloaded@monai-support"] mlflow = ["mlflow>=3.15.2"] nibabel = ["nibabel"] @@ -147,6 +148,7 @@ pynrrd = ["pynrrd"] pynvml = ["nvidia-ml-py"] pyyaml = ["pyyaml"] requests = ["requests"] +# per #5882 this requirement must be on one line to get removed by sed in weekly-preview.yml segment_anything = ["segment_anything @ git+https://github.com/facebookresearch/segment-anything.git@6fdee8f2727f4506cfbbe553e23b895e27956588"] scipy = ["scipy>=1.12.0"] skimage = ["scikit-image>=0.19.0"]