Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve NVTX Range Naming #3484

Merged
merged 7 commits into from
Dec 14, 2021
Merged

Improve NVTX Range Naming #3484

merged 7 commits into from
Dec 14, 2021

Conversation

drbeh
Copy link
Member

@drbeh drbeh commented Dec 14, 2021

Description

This PR make some improvement in NVTX Range.

  • To not have redundant numbering when a transform is used once, it does not append number to the first call of a transform but will start the numbering for the next ones from two (e.g., Transform, Transform_2, Transform_3, etc)
  • When wrapper transforms are being used (i.e. CuCIM and TorchVision), it extract the underlying transfrom name that are being called and append to the name of the transform for profiling.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.

Copy link
Collaborator

@dongyang0122 dongyang0122 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me.

monai/utils/nvtx.py Outdated Show resolved Hide resolved
@drbeh drbeh requested a review from wyli December 14, 2021 16:00
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it looks good to me.

@wyli
Copy link
Contributor

wyli commented Dec 14, 2021

/build

@wyli wyli enabled auto-merge (squash) December 14, 2021 16:07
@wyli wyli merged commit f6648a3 into Project-MONAI:dev Dec 14, 2021
@drbeh drbeh deleted the improve-nvtx branch December 14, 2021 20:30
wyli pushed a commit that referenced this pull request Jan 4, 2022
* Update to not include number for the name of the first range

Signed-off-by: Behrooz <[email protected]>

* Update CuCIM and TorchVision wrappers to include name

Signed-off-by: Behrooz <[email protected]>

* Update nvtx range to append undelying class for wrapper tranforms

Signed-off-by: Behrooz <[email protected]>

* Add new test cases to cover changes

Signed-off-by: Behrooz <[email protected]>

* Update cucim and torchvision check

Signed-off-by: Behrooz <[email protected]>
wyli pushed a commit that referenced this pull request Jan 4, 2022
* Update to not include number for the name of the first range

Signed-off-by: Behrooz <[email protected]>

* Update CuCIM and TorchVision wrappers to include name

Signed-off-by: Behrooz <[email protected]>

* Update nvtx range to append undelying class for wrapper tranforms

Signed-off-by: Behrooz <[email protected]>

* Add new test cases to cover changes

Signed-off-by: Behrooz <[email protected]>

* Update cucim and torchvision check

Signed-off-by: Behrooz <[email protected]>
Can-Zhao added a commit that referenced this pull request Jan 5, 2022
* 3415 Update WSIReader (#3417)

* Update WSIReader level/location/size calculation

Signed-off-by: Behrooz <[email protected]>

* Update location downsampling

Signed-off-by: Behrooz <[email protected]>

* Update tests and add a new test case

Signed-off-by: Behrooz <[email protected]>

* Update few names and logics

Signed-off-by: Behrooz <[email protected]>

* Fix the dependency issue

Signed-off-by: Behrooz <[email protected]>

* Check for imagecodecs + tifffile

Signed-off-by: Behrooz <[email protected]>

* Remove new test case that uses too much memory

Signed-off-by: Behrooz <[email protected]>

* Add new case and ignore level=0 for TiffFile

Signed-off-by: Behrooz <[email protected]>

* Address comments

Signed-off-by: Behrooz <[email protected]>

Co-authored-by: Nic Ma <[email protected]>

* update create_file_basename (#3436)

Signed-off-by: Wenqi Li <[email protected]>

* Update TiffFile backend in WSIReader (#3438)

* Update TiffFile backend to read only the entire image

Signed-off-by: Behrooz <[email protected]>

* 3429 Enhance the scalar write logic of TensorBoardStatsHandler (#3431)

* [DLMED] extract write logic

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* 3430 support dataframes and streams in CSVDataset (#3440)

* [DLMED] add dataframe

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance CSV iterable dataset

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add unit tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix typehints

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add comment

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix file close issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix doc

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

Co-authored-by: monai-bot <[email protected]>

* Add base class for workflows (#3445)

* [DLMED] add BaseWorkflow

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix typo

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] add *args, **kwargs

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: monai-bot <[email protected]>

* Enhance deprecated arg for kwargs in CSV datasets (#3446)

* [DLMED] fix deprecated arg

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

Co-authored-by: monai-bot <[email protected]>

* 3293 Remove extra deep supervision modules of DynUNet (#3427)

* enhance dynunet

Signed-off-by: Yiheng Wang <[email protected]>

* fix black issue

Signed-off-by: Yiheng Wang <[email protected]>

* use strict=False

Signed-off-by: Yiheng Wang <[email protected]>

* fix black 21.12 error

Signed-off-by: Yiheng Wang <[email protected]>

* enhance code and update docstring

Signed-off-by: Yiheng Wang <[email protected]>

* 471- fixes deprecated args (#3447)

* fixes deprecated args

Signed-off-by: Wenqi Li <[email protected]>

* update based on comments

Signed-off-by: Wenqi Li <[email protected]>

* improve error message if reader nott available (#3457)

improve error message if reader nott available

* adds the missing imports (#3462)

Signed-off-by: Wenqi Li <[email protected]>

* revise MILModel docstring (#3459)

Signed-off-by: Wenqi Li <[email protected]>

* deprecate reduction (#3464)

Signed-off-by: Wenqi Li <[email protected]>

* 3444 Add DatasetFunc (#3456)

* [DLMED] add dataset generator

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add DatasetGenerator

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] fix wrong test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] simplify according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove return

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update rtol for CI

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: monai-bot <[email protected]>

* Add missing components to API doc (#3468)

* [DLMED] add missing docs

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add missing components

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix test

Signed-off-by: Nic Ma <[email protected]>

* 3466 3467 Add `channel_wise` and correct doc-string (#3469)

* [DLMED] add channel-wise

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] skip test if before 1.7

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

Co-authored-by: monai-bot <[email protected]>

* [DLMED] remove cls (#3475)

Signed-off-by: Nic Ma <[email protected]>

* Add Iteration base class (#3472)

* [DLMED] add Iteration base class

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* fix link error (#3488)

Signed-off-by: Yiheng Wang <[email protected]>

* 3465 Support string as dtype (#3478)

* [DLMED] support string dtype

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance dtype in ToCupy

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update to 0.4.7 (#3483)

Signed-off-by: Nic Ma <[email protected]>

* Improve NVTX Range Naming (#3484)

* Update to not include number for the name of the first range

Signed-off-by: Behrooz <[email protected]>

* Update CuCIM and TorchVision wrappers to include name

Signed-off-by: Behrooz <[email protected]>

* Update nvtx range to append undelying class for wrapper tranforms

Signed-off-by: Behrooz <[email protected]>

* Add new test cases to cover changes

Signed-off-by: Behrooz <[email protected]>

* Update cucim and torchvision check

Signed-off-by: Behrooz <[email protected]>

* 3471 3491 Add example images for intensity transforms (#3494)

* [DLMED] add missing images

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix 3471

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix AsDiscrete

Signed-off-by: Nic Ma <[email protected]>

* Make bending energy loss invariant to resolution (#3493)

* make bending energy loss invariant to resolution

fixes #3485

Signed-off-by: Ebrahim Ebrahim <[email protected]>

* set BendingEnergyLoss default normalize to False

Maybe it's more important that the default behavior match usage of the
term "bending energy" elsewhere, rather than that it be the most
convenient behavior.

Signed-off-by: Ebrahim Ebrahim <[email protected]>

* Removes redundant casting -- ensure tuple (#3495)

Signed-off-by: Wenqi Li <[email protected]>

* 3498 Correct `kwargs` arg for `convert_to_torchscript` (#3499)

* [DLMED] correct kwargs

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix grammar

Signed-off-by: Nic Ma <[email protected]>

* update tests with 1.10.1 (#3500)

Signed-off-by: Wenqi Li <[email protected]>

* 3501 Add dict version SavitzkyGolaySmoothd (#3502)

* [DLMED] add SavitzkyGolaySmoothd

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* remove file (#3507)

Signed-off-by: Wenqi Li <[email protected]>

* avoid 60.0.0 (#3514)

Signed-off-by: Wenqi Li <[email protected]>

* [DLMED] add 6 new transform images (#3512)

Signed-off-by: Nic Ma <[email protected]>

* support of reversed indexing (#3508)

Signed-off-by: Wenqi Li <[email protected]>

* Adding Torchscript utility functions (#3138)

* Adding Torchscript utility functions

Signed-off-by: Eric Kerfoot <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* Adding Torchscript utility functions

Signed-off-by: Eric Kerfoot <[email protected]>

* Added test for extra files

Signed-off-by: Eric Kerfoot <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update

Signed-off-by: Eric Kerfoot <[email protected]>

* Update

Signed-off-by: Eric Kerfoot <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update

Signed-off-by: Eric Kerfoot <[email protected]>

* Update

Signed-off-by: Eric Kerfoot <[email protected]>

* Updates

Signed-off-by: Eric Kerfoot <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updates

Signed-off-by: Eric Kerfoot <[email protected]>

* Updates

Signed-off-by: Eric Kerfoot <[email protected]>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: monai-bot <[email protected]>
Co-authored-by: Nic Ma <[email protected]>

* 3517 Refine AddCoordinateChannels transform (#3524)

* [DLMED] change to utility transforms

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance args

Signed-off-by: Nic Ma <[email protected]>

* 3521 Copyright header update (#3522)

* adds missing item

Signed-off-by: Wenqi Li <[email protected]>

* update the contributing guide

Signed-off-by: Wenqi Li <[email protected]>

* update copyright headers

Signed-off-by: Wenqi Li <[email protected]>

* 3521 - adds a util to check the licence info (#3523)

* util to check the licence info

Signed-off-by: Wenqi Li <[email protected]>

* update flags

Signed-off-by: Wenqi Li <[email protected]>

* update based on comments

Signed-off-by: Wenqi Li <[email protected]>

* 3350 Remove PyTorch 1.5.x related logic and mark versions for all new APIs (#3526)

* [DLMED] clarify old APIs

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* 3533 Update PyTorch docker to 21.12 (#3534)

* [DLMED] update to 21.12

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add PyTorch 1.9 test

Signed-off-by: Nic Ma <[email protected]>

* 3531 Add args to subclass of CacheDataset (#3532)

* [DLMED] add missing args

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update progress arg

Signed-off-by: Nic Ma <[email protected]>

* 3525 Fix invertible issue in OneOf compose (#3530)

* [DLMED] fix oneof

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more unit tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update index

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* Revert "[DLMED] update according to comments"

This reverts commit c6c3a35.

Signed-off-by: Nic Ma <[email protected]>

* Revert "[DLMED] update index"

This reverts commit 649a7c5.

Signed-off-by: Nic Ma <[email protected]>

* 3535 - drop python 36 support (#3536)

* drop py36 support

Signed-off-by: Wenqi Li <[email protected]>

* drop 20.09 test because of python min version 3.6

Signed-off-by: Wenqi Li <[email protected]>

* update tests

Signed-off-by: Wenqi Li <[email protected]>

* error->warning, revise copyright

Signed-off-by: Wenqi Li <[email protected]>

* 3541 has cupy check (#3544)

* has cupy check

Signed-off-by: Wenqi Li <[email protected]>

* update based on comments

Signed-off-by: Wenqi Li <[email protected]>

* 3053 release *_dist.py tests memory to avoid OOM (#3537)

* adds min. memory testing utils

Signed-off-by: Wenqi Li <[email protected]>

* include valueerror for robust outcome

Signed-off-by: Wenqi Li <[email protected]>

* ensure float

Signed-off-by: Wenqi Li <[email protected]>

* msg improvements

Signed-off-by: Wenqi Li <[email protected]>

* update threshold

Signed-off-by: Wenqi Li <[email protected]>

* remove ref

Signed-off-by: Wenqi Li <[email protected]>

* separate disttests

Signed-off-by: Wenqi Li <[email protected]>

* update based on comments

Signed-off-by: Wenqi Li <[email protected]>

* 3539 Remove decollate warning (#3545)

* [DLMED] remove warning

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance set_determinism (#3547)

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: Wenqi Li <[email protected]>

* Smooth Deform (#3551)

* Adding smooth deform transform

Signed-off-by: Eric Kerfoot <[email protected]>

* Update

Signed-off-by: Eric Kerfoot <[email protected]>

* Updates

Signed-off-by: Eric Kerfoot <[email protected]>

* Docs update

Signed-off-by: Eric Kerfoot <[email protected]>

* Type fixing

Signed-off-by: Eric Kerfoot <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* Fix

Signed-off-by: Eric Kerfoot <[email protected]>

* Fix

Signed-off-by: Eric Kerfoot <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix for moveaxis

Signed-off-by: Eric Kerfoot <[email protected]>

* Fix for moveaxis

Signed-off-by: Eric Kerfoot <[email protected]>

* Adding example images, random field sized reduced to (10,10,10)

Signed-off-by: Eric Kerfoot <[email protected]>

* Changed backend

Signed-off-by: Eric Kerfoot <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* Tweak

Signed-off-by: Eric Kerfoot <[email protected]>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: monai-bot <[email protected]>

* 3552 - runtest.sh defaults to no build/install (#3555)

* runtest.sh defaults to no build/install

Signed-off-by: Wenqi Li <[email protected]>

* following test case conventions for multiprocessing

- adding `_dist` to multiprocessing test cases
- decouple multiprocessing LMDB tests from `test_lmdbdataset`

Signed-off-by: Wenqi Li <[email protected]>

* exclude lmdbdataset tests in min_tests

Signed-off-by: Wenqi Li <[email protected]>

Co-authored-by: Eric Kerfoot <[email protected]>

* Remove apply_same_field (#3556)

Signed-off-by: Eric Kerfoot <[email protected]>

* skipping pretraining network loading when downloading is unsuccessful (#3558)

Signed-off-by: Wenqi Li <[email protected]>

* [DLMED] fix mypy errors (#3562)

Signed-off-by: Nic Ma <[email protected]>

* 3559 Enhance `DatasetSummary` for several points (#3560)

* [DLMED] update dataset summary

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance data type

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix pickle issue

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: Wenqi Li <[email protected]>

* add box util in monai/data

* add box util in monai/data

* [pre-commit.ci] pre-commit suggestions (#3568)

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0)
- [github.com/asottile/pyupgrade: v2.29.0 → v2.31.0](asottile/pyupgrade@v2.29.0...v2.31.0)
- [github.com/asottile/yesqa: v1.2.3 → v1.3.0](asottile/yesqa@v1.2.3...v1.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* 3565 - adds metadata when loading dicom series (#3566)

* adds metadata when loading dicom series

Signed-off-by: Wenqi Li <[email protected]>

* fixes timed tests

Signed-off-by: Wenqi Li <[email protected]>

* update based on comments

Signed-off-by: Wenqi Li <[email protected]>

* 3580 - create codeql-analysis.yml (#3579)

* Create codeql-analysis.yml

Signed-off-by: Wenqi Li <[email protected]>

* build cpp

Signed-off-by: Wenqi Li <[email protected]>

* fixes Multiplication result converted to larger type

Signed-off-by: Wenqi Li <[email protected]>

* fixes url parsing

Signed-off-by: Wenqi Li <[email protected]>

* 498 Add logger_handler to LrScheduleHandler (#3570)

* [DLMED] add log handler

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix CI tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix CI test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] test CI

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix logging

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] temp test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix wrong unit test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix wrong test cases

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: Behrooz <[email protected]>
Co-authored-by: Nic Ma <[email protected]>
Co-authored-by: Wenqi Li <[email protected]>
Co-authored-by: monai-bot <[email protected]>
Co-authored-by: Yiheng Wang <[email protected]>
Co-authored-by: Richard Brown <[email protected]>
Co-authored-by: Ebrahim Ebrahim <[email protected]>
Co-authored-by: Eric Kerfoot <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants