Skip to content

Commit 897db2c

Browse files
authored
Merge pull request #212 from rapidsai/branch-22.02
[RELEASE] cucim v22.02
2 parents 6d1f082 + ceb51fc commit 897db2c

File tree

259 files changed

+12365
-4889
lines changed

Some content is hidden

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

259 files changed

+12365
-4889
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,5 @@ conda-bld
153153
# Large Images
154154
*.svs
155155

156+
# Custom debug environment setup script for VS Code (used by scripts/debug_python)
157+
/scripts/debug_env.sh

.idea/cucim.iml

Lines changed: 2 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3rdparty/LICENSE.taskflow

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
TASKFLOW MIT LICENSE
2+
3+
Copyright (c) 2018-2021 Dr. Tsung-Wei Huang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

CHANGELOG.md

Lines changed: 141 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,145 @@
1-
# cuCIM 21.12.00 (Date TBD)
1+
# cuCIM 22.02.00 (2 Feb 2022)
22

3-
Please see https://github.com/rapidsai/cucim/releases/tag/v21.12.00a for the latest changes to this development branch.
3+
## 🚨 Beaking Changes
4+
5+
- Update cucim.skimage API to match scikit-image 0.19 ([#190](https://github.com/rapidsai/cucim/pull/190)) [@glee77](https://github.com/glee77)
6+
7+
## 📖 Documentation
8+
9+
- PyPI v21.12.00 elease ([#182](https://github.com/rapidsai/cucim/pull/182)) [@gigony](https://github.com/gigony)
10+
11+
## 🚀 New Featues
12+
13+
- Allow CuPy 10 ([#195](https://github.com/rapidsai/cucim/pull/195)) [@jakikham](https://github.com/jakikham)
14+
- Suppot multi-theads and batch, and suppot nvJPEG fo JPEG-compessed images ([#191](https://github.com/rapidsai/cucim/pull/191)) [@gigony](https://github.com/gigony)
15+
- Update cucim.skimage API to match scikit-image 0.19 ([#190](https://github.com/rapidsai/cucim/pull/190)) [@glee77](https://github.com/glee77)
16+
17+
## 🛠️ Impovements
18+
19+
- Upgade Numpy to 1.19 fo Python 3.9 suppot ([#203](https://github.com/rapidsai/cucim/pull/203)) [@Ethyling](https://github.com/Ethyling)
20+
- Allow installation with CuPy 10 ([#197](https://github.com/rapidsai/cucim/pull/197)) [@glee77](https://github.com/glee77)
21+
- Upgade Numpy to 1.18 fo Python 3.9 suppot ([#196](https://github.com/rapidsai/cucim/pull/196)) [@Ethyling](https://github.com/Ethyling)
22+
- Add missing impots tests ([#183](https://github.com/rapidsai/cucim/pull/183)) [@Ethyling](https://github.com/Ethyling)
23+
24+
# cuCIM 21.12.00 (9 Dec 2021)
25+
26+
## 🚀 New Features
27+
28+
1. Support Aperio SVS with CPU LZW and jpeg2k decoder ([#141](https://github.com/rapidsai/cucim/pull/141)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
29+
2. Add NVTX support for performance analysis ([#144](https://github.com/rapidsai/cucim/pull/144)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
30+
3. Normalize operation ([#150](https://github.com/rapidsai/cucim/pull/150)) [[@shekhardw](https://github.com/shekhardw)](https://github.com/shekhardw](https://github.com/shekhardw))
31+
32+
### 1. Support Aperio SVS (.svs)
33+
34+
cuCIM now supports [Aperio SVS format](https://openslide.org/formats/aperio/) with help of [OpenJpeg](https://www.openjpeg.org/) for decoding jpeg2k-compressed data.
35+
36+
Please check [this notebook](https://nbviewer.org/github/rapidsai/cucim/blob/branch-21.12/notebooks/Supporting_Aperio_SVS_Format.ipynb) to see how to use the feature.
37+
38+
#### Unaligned Case (`per_process`, JPEG-compressed SVS file)
39+
40+
![image](https://user-images.githubusercontent.com/1928522/141350490-06fdd8cb-5be2-42e4-9774-c7b76fab6f9a.png)
41+
42+
#### Unaligned Case (`per_process`, JPEG2000 RGB-compressed SVS file)
43+
44+
![image](https://user-images.githubusercontent.com/1928522/141093324-574b532e-ad42-4d61-8473-4c3e07e3feae.png)
45+
46+
#### Unaligned Case (`per_process`, JPEG2000 YCbCr-compressed SVS file)
47+
48+
![image](https://user-images.githubusercontent.com/1928522/141093381-8ab0161d-1b17-4e80-a680-86abfbf2fa65.png)
49+
50+
The detailed data is available [here](https://docs.google.com/spreadsheets/d/15D1EqNI_E9x_S8i3kJLwBxMcEmwk8SafW0WryMrAm6A/edit#gid=369408723).
51+
52+
### 2. Add NVTX support for performance analysis
53+
54+
Important methods in cuCIM are instrumented with [NVTX](https://docs.nvidia.com/gameworks/index.html#gameworkslibrary/nvtx/nvidia_tools_extension_library_nvtx.htm) so can see performance bottlenecks easily with [NSight systems](https://developer.nvidia.com/nsight-systems).
55+
56+
Tracing can be enabled through config file or environment variable or through API and less than 1% performance overheads in normal execution.
57+
58+
#### Enabling Tracing
59+
##### Through `.cucim.json` file
60+
61+
```json
62+
{
63+
"profiler" : { "trace": true }
64+
}
65+
```
66+
67+
##### Through Environment variable
68+
69+
```bash
70+
CUCIM_TRACE=1 python
71+
```
72+
73+
##### Through API
74+
75+
```python
76+
from cucim import CuImage
77+
78+
CuImage.profiler(trace=True)
79+
#or
80+
CuImage.profiler().trace(True)
81+
82+
CuImage.profiler().config
83+
# {'trace': True}
84+
CuImage.profiler().trace()
85+
# True
86+
CuImage.is_trace_enabled # this is simpler method.
87+
# True
88+
```
89+
90+
#### Profiling with NVIDIA Nsight Systems
91+
92+
```bash
93+
nsys profile -f true -t cuda,nvtx,osrt -s cpu -x true --trace-fork-before-exec true -o my_profile `which python` benchmark.py
94+
# can add `--stats true`
95+
```
96+
97+
Then, execute `nsight-sys` to open the profile results (my_profile.qdrep).
98+
99+
![image](https://user-images.githubusercontent.com/1928522/141221297-2ff5224b-e99b-4fe6-af7d-69452141d71d.png)
100+
101+
With this feature, a bug in cuCIM [v21.10.01](https://github.com/rapidsai/cucim/wiki/release_notes_v21.10.01) (thread contention in Cache) was found and fixed ([#145](https://github.com/rapidsai/cucim/pull/145)).
102+
103+
### 3. Normalize operation
104+
105+
CUDA-based normalization operation is added. Normalization supports the following types.
106+
107+
1. Simple range based normalization
108+
2. Arctangent based normalization
109+
110+
Arctangent-based normalization helps to stretch lower intensity pixels in the image slightly better than range-based normalization. If you look at its [graph](https://mathworld.wolfram.com/InverseTangent.html), there is a huge variation at certain lower intensities, but as intensities become higher, the curve becomes flatter. This helps in isolating regions like lungs (and regions within lungs) more efficiently. There can be separate use cases depending on the modality and the application.
111+
112+
Please check the [test cases](https://github.com/rapidsai/cucim/blob/branch-21.12/python/cucim/src/cucim/core/operations/intensity/tests/test_normalize.py) to see how you can use the operation.
113+
114+
115+
## 🐛 Bug Fixes
116+
117+
- Load libcufile.so with RTLD_NODELETE flag ([#177](https://github.com/rapidsai/cucim/pull/177)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
118+
- Remove rmm/nvcc dependencies to fix cudaErrorUnsupportedPtxVersion error ([#175](https://github.com/rapidsai/cucim/pull/175)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
119+
- Do not compile code with nvcc if no CUDA kernel exists ([#171](https://github.com/rapidsai/cucim/pull/171)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
120+
- Fix a segmentation fault due to unloaded libcufile ([#158](https://github.com/rapidsai/cucim/pull/158)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
121+
- Fix thread contention in Cache ([#145](https://github.com/rapidsai/cucim/pull/145)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
122+
- Build with NumPy 1.17 ([#148](https://github.com/rapidsai/cucim/pull/148)) [[@jakirkham](https://github.com/jakirkham)](https://github.com/jakirkham](https://github.com/jakirkham))
123+
124+
## 📖 Documentation
125+
126+
- Add Jupyter notebook for SVS Support ([#147](https://github.com/rapidsai/cucim/pull/147)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
127+
- Update change log for v21.10.01 ([#142](https://github.com/rapidsai/cucim/pull/142)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
128+
- update docs theme to pydata-sphinx-theme ([#138](https://github.com/rapidsai/cucim/pull/138)) [[@quasiben](https://github.com/quasiben)](https://github.com/quasiben](https://github.com/quasiben))
129+
- Update Github links in README.md through script ([#132](https://github.com/rapidsai/cucim/pull/132)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
130+
- Fix GDS link in Jupyter notebook ([#131](https://github.com/rapidsai/cucim/pull/131)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
131+
- Update notebook for the interoperability with DALI ([#127](https://github.com/rapidsai/cucim/pull/127)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
132+
133+
134+
135+
## 🛠️ Improvements
136+
137+
- Update `conda` recipes for Enhanced Compatibility effort by ([#164](https://github.com/rapidsai/cucim/pull/164)) [[@ajschmidt8](https://github.com/ajschmidt8)](https://github.com/ajschmidt8](https://github.com/ajschmidt8))
138+
- Fix Changelog Merge Conflicts for `branch-21.12` ([#156](https://github.com/rapidsai/cucim/pull/156)) [[@ajschmidt8](https://github.com/ajschmidt8)](https://github.com/ajschmidt8](https://github.com/ajschmidt8))
139+
- Add cucim.kit.cumed plugin with skeleton ([#129](https://github.com/rapidsai/cucim/pull/129)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
140+
- Update initial cpp unittests ([#128](https://github.com/rapidsai/cucim/pull/128)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
141+
- Optimize zoom out implementation with separate padding kernel ([#125](https://github.com/rapidsai/cucim/pull/125)) [[@chirayuG-nvidia](https://github.com/chirayuG-nvidia)](https://github.com/chirayuG-nvidia](https://github.com/chirayuG-nvidia))
142+
- Do not force install linux-64 version of openslide-python ([#124](https://github.com/rapidsai/cucim/pull/124)) [[@Ethyling](https://github.com/Ethyling)](https://github.com/Ethyling](https://github.com/Ethyling))
4143

5144
# cuCIM 21.10.00 (7 Oct 2021)
6145

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ superbuild_depend(json)
126126
superbuild_depend(libcuckoo)
127127
superbuild_depend(boost-header-only)
128128
superbuild_depend(nvtx3)
129+
superbuild_depend(taskflow)
129130

130131
################################################################################
131132
# Define some names

LICENSE-3rdparty.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ DLPack
8585
- https://github.com/dmlc/dlpack/blob/main/LICENSE
8686
- Copyright: DLPack Contributors
8787

88-
NVIDIA CUDA TOOLKIT (including libcufile)
88+
NVIDIA CUDA TOOLKIT (including libcufile/libnvjpeg)
8989
- License: NVIDIA License
9090
- https://docs.nvidia.com/cuda/pdf/EULA.pdf
9191
- Copyright: NVIDIA Corporation
@@ -269,3 +269,9 @@ NVTX (NVIDIA Tool Extension Library)
269269
- https://raw.githubusercontent.com/NVIDIA/NVTX/release-v3/LICENSE.txt
270270
- Copyright: NVIDIA Corporation
271271
- Usage: Support for profiling with NVIDIA Nsight Systems
272+
273+
Taskflow
274+
- License: MIT License
275+
- https://github.com/taskflow/taskflow
276+
- Copyright: Dr. Tsung-Wei Huang
277+
- Usage: Threadpool implementation for batch processing.

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,30 @@
1616

1717
### Conda
1818

19-
#### Conda (stable)
19+
#### [Conda (stable)](https://anaconda.org/rapidsai/cucim)
2020

2121
> conda create -n cucim -c rapidsai -c conda-forge cucim cudatoolkit=`<CUDA version>`
2222
2323
`<CUDA version>` should be 11.0+ (e.g., `11.0`, `11.2`, etc.)
2424

25-
#### Conda (nightlies)
25+
#### [Conda (nightlies)](https://anaconda.org/rapidsai-nightly/cucim)
2626

2727
> conda create -n cucim -c rapidsai-nightly -c conda-forge cucim cudatoolkit=`<CUDA version>`
2828
2929
`<CUDA version>` should be 11.0+ (e.g., `11.0`, `11.2`, etc)
3030

31+
### [PyPI](https://pypi.org/project/cucim/)
32+
33+
```bash
34+
pip install cucim
35+
36+
# Install dependencies for `cucim.skimage` (assuming that CUDA 11.0 is used for CuPy)
37+
pip install scipy scikit-image cupy-cuda110
38+
```
39+
3140
### Notebooks
3241

33-
Please check out our [Welcome](notebooks/Welcome.ipynb) notebook ([NBViewer](https://nbviewer.jupyter.org/github/rapidsai/cucim/blob/branch-21.12/notebooks/Welcome.ipynb))
42+
Please check out our [Welcome](notebooks/Welcome.ipynb) notebook ([NBViewer](https://nbviewer.jupyter.org/github/rapidsai/cucim/blob/branch-22.02/notebooks/Welcome.ipynb))
3443

3544
#### Downloading sample images
3645

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21.12.00
1+
22.02.00

benchmarks/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ static void test_cucim(benchmark::State& state)
6565

6666
cucim::CuImage image = cucim::CuImage(input_path.c_str());
6767
cucim::CuImage region =
68-
image.read_region({ request_location[0], request_location[1] }, { state.range(0), state.range(0) }, 0,
69-
cucim::DimIndices{}, "cpu", nullptr, "");
68+
image.read_region({ request_location[0], request_location[1] }, { state.range(0), state.range(0) }, 0);
7069
}
7170
}
7271

benchmarks/skimage/cucim_exposure_bench.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ def set_args(self, dtype):
112112
for shape in [(512, 512), (3840, 2160), (3840, 2160, 3), (192, 192, 192)]:
113113
ndim = len(shape)
114114

115-
multichannel = shape[-1] in [3, 4]
115+
channel_axis = -1 if shape[-1] in [3, 4] else None
116116

117117
B = MatchHistogramBench(
118118
function_name="match_histograms",
119119
shape=shape,
120120
dtypes=dtypes,
121-
fixed_kwargs=dict(multichannel=multichannel),
121+
fixed_kwargs=dict(channel_axis=channel_axis),
122122
var_kwargs=dict(),
123123
module_cpu=skimage.exposure,
124124
module_gpu=cucim.skimage.exposure,

0 commit comments

Comments
 (0)