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

transformer block local window attention #7348

Draft
wants to merge 38 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fac754d
6676 port generative networks autoencoderkl (#7260)
marksgraham Dec 5, 2023
b3fdfdd
6676 port generative networks vqvae (#7285)
marksgraham Dec 7, 2023
c61c6ac
6676 port generative networks transformer (#7300)
marksgraham Dec 11, 2023
de0a476
6676 port generative networks ddpm (#7304)
marksgraham Dec 12, 2023
43bc023
6676 port generative networks controlnet (#7312)
marksgraham Dec 14, 2023
b85a534
Adds patchgan discriminator (#7319)
marksgraham Dec 14, 2023
aa4a4db
6676 port generative networks spade (#7320)
marksgraham Dec 19, 2023
3447b09
6676 port diffusion schedulers (#7332)
marksgraham Jan 3, 2024
3ab5c62
6676 port diffusion schedulers (#7364)
marksgraham Jan 5, 2024
0a549fe
Adds ordering util (#7369)
marksgraham Jan 8, 2024
510f7bc
6676 port generative inferers (#7379)
marksgraham Jan 18, 2024
41fb3ff
[Attention block] relative positional embedding (#7346)
vgrau98 Jan 18, 2024
39a6f57
causal self attention
vgrau98 Jan 24, 2024
5b3c4f3
causal selfattention tests
vgrau98 Jan 24, 2024
440a893
integrate flash attention usage
vgrau98 Apr 27, 2024
7531b5c
update the Python version requirements for transformers (#7275)
KumoLiu Dec 5, 2023
be576a3
7263 add diffusion loss (#7272)
kvttt Dec 5, 2023
603bd53
Fix swinunetrv2 2D bug (#7302)
heyufan1995 Dec 8, 2023
a5d5f7c
Fix `RuntimeError` in `DataAnalyzer` (#7310)
KumoLiu Dec 12, 2023
e7e07a9
Support specified filenames in `Saveimage` (#7318)
KumoLiu Dec 14, 2023
90c5d95
Fix typo (#7321)
KumoLiu Dec 15, 2023
ad37c17
fix optimizer pararmeter issue (#7322)
binliunls Dec 15, 2023
3c1dea0
Fix `lazy` ignored in `SpatialPadd` (#7316)
KumoLiu Dec 18, 2023
c1a0f06
Update openslide-python version (#7344)
KumoLiu Dec 28, 2023
58e7db5
Upgrade the version of `transformers` (#7343)
KumoLiu Dec 29, 2023
3b13ddd
transformer block local window attention
vgrau98 Dec 30, 2023
867ec07
fix: window partition input shapes
vgrau98 Jan 2, 2024
980a832
fix: error handling
vgrau98 Jan 2, 2024
c2f121b
local window attention tests
vgrau98 Jan 2, 2024
46ee2b0
feat: 3d local window attention
vgrau98 Jan 2, 2024
dc7efd4
3d local attention window tests
vgrau98 Jan 2, 2024
1ab0a74
Bump github/codeql-action from 2 to 3 (#7354)
dependabot[bot] Jan 2, 2024
fe6d2e3
Bump actions/upload-artifact from 3 to 4 (#7350)
dependabot[bot] Jan 2, 2024
f46c509
Bump actions/setup-python from 4 to 5 (#7351)
dependabot[bot] Jan 2, 2024
035e6c4
Bump actions/download-artifact from 3 to 4 (#7352)
dependabot[bot] Jan 2, 2024
eec3308
Bump peter-evans/slash-command-dispatch from 3.0.1 to 3.0.2 (#7353)
dependabot[bot] Jan 3, 2024
7d82d8a
clean
vgrau98 Jan 6, 2024
0132e6b
refacto
vgrau98 Jan 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: dispatch
uses: peter-evans/[email protected].1
uses: peter-evans/[email protected].2
with:
token: ${{ secrets.PR_MAINTAIN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand Down Expand Up @@ -72,4 +72,4 @@ jobs:
BUILD_MONAI=1 ./runtests.sh --build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/cron-ngc-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: cache weekly timestamp
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
ref: dev
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- shell: bash
Expand All @@ -36,7 +36,7 @@ jobs:
python setup.py build
cat build/lib/monai/_version.py
- name: Upload version
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: _version.py
path: build/lib/monai/_version.py
Expand All @@ -56,7 +56,7 @@ jobs:
with:
ref: dev
- name: Download version
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: _version.py
- name: docker_build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pythonapp-min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Prepare pip wheel
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Prepare pip wheel
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Prepare pip wheel
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: cache weekly timestamp
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
disk-root: "D:"
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Prepare pip wheel
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: cache weekly timestamp
Expand Down Expand Up @@ -209,7 +209,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: cache weekly timestamp
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:

- if: matrix.python-version == '3.9' && startsWith(github.ref, 'refs/tags/')
name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- shell: bash
Expand All @@ -108,7 +108,7 @@ jobs:
python setup.py build
cat build/lib/monai/_version.py
- name: Upload version
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: _version.py
path: build/lib/monai/_version.py
Expand All @@ -125,7 +125,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download version
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: _version.py
- name: Set tag
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: cache weekly timestamp
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: cache weekly timestamp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
ref: dev
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install setuptools
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sphinxcontrib-serializinghtml
sphinx-autodoc-typehints==1.11.1
pandas
einops
transformers<4.22 # https://github.com/Project-MONAI/MONAI/issues/5157
transformers<4.22; python_version <= '3.10' # https://github.com/Project-MONAI/MONAI/issues/5157
mlflow>=1.28.0
clearml>=1.10.0rc0
tensorboardX
Expand Down
23 changes: 23 additions & 0 deletions docs/source/inferers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ Inferers
:members:
:special-members: __call__

`DiffusionInferer`
~~~~~~~~~~~~~~~~~~
.. autoclass:: DiffusionInferer
:members:
:special-members: __call__

`LatentDiffusionInferer`
~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: LatentDiffusionInferer
:members:
:special-members: __call__

`ControlNetDiffusionInferer`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ControlNetDiffusionInferer
:members:
:special-members: __call__

`ControlNetLatentDiffusionInferer`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ControlNetLatentDiffusionInferer
:members:
:special-members: __call__

Splitters
---------
Expand Down
5 changes: 5 additions & 0 deletions docs/source/losses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ Registration Losses
.. autoclass:: BendingEnergyLoss
:members:

`DiffusionLoss`
~~~~~~~~~~~~~~~
.. autoclass:: DiffusionLoss
:members:

`LocalNormalizedCrossCorrelationLoss`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: LocalNormalizedCrossCorrelationLoss
Expand Down
81 changes: 81 additions & 0 deletions docs/source/networks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ Blocks
.. autoclass:: monai.apps.reconstruction.networks.blocks.varnetblock.VarNetBlock
:members:

`Attention utilities`
~~~~~~~~~~~~~~~~~~~~~
.. automodule:: monai.networks.blocks.attention_utils
.. autofunction:: monai.networks.blocks.attention_utils.get_rel_pos
.. autofunction:: monai.networks.blocks.attention_utils.add_decomposed_rel_pos

N-Dim Fourier Transform
~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: monai.networks.blocks.fft_utils_t
Expand All @@ -258,6 +264,11 @@ N-Dim Fourier Transform
.. autofunction:: monai.networks.blocks.fft_utils_t.fftshift
.. autofunction:: monai.networks.blocks.fft_utils_t.ifftshift

`SPADE`
~~~~~~~
.. autoclass:: monai.networks.blocks.spade_norm.SPADE
:members:

Layers
------

Expand Down Expand Up @@ -408,6 +419,13 @@ Layers
.. autoclass:: LLTM
:members:

`Vector Quantizer`
~~~~~~~~~~~~~~~~~~
.. autoclass:: monai.networks.layers.vector_quantizer.EMAQuantizer
:members:
.. autoclass:: monai.networks.layers.vector_quantizer.VectorQuantizer
:members:

`Utilities`
~~~~~~~~~~~
.. automodule:: monai.networks.layers.convutils
Expand Down Expand Up @@ -575,6 +593,21 @@ Nets
.. autoclass:: VNet
:members:

`DiffusionModelUnet`
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: DiffusionModelUNet
:members:

`SPADEDiffusionModelUNet`
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: SPADEDiffusionModelUNet
:members:

`ControlNet`
~~~~~~~~~~~~
.. autoclass:: ControlNet
:members:

`RegUNet`
~~~~~~~~~
.. autoclass:: RegUNet
Expand All @@ -595,11 +628,26 @@ Nets
.. autoclass:: AutoEncoder
:members:

`AutoEncoderKL`
~~~~~~~~~~~~~~~
.. autoclass:: AutoencoderKL
:members:

`SPADEAutoencoderKL`
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: SPADEAutoencoderKL
:members:

`VarAutoEncoder`
~~~~~~~~~~~~~~~~
.. autoclass:: VarAutoEncoder
:members:

`DecoderOnlyTransformer`
~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: DecoderOnlyTransformer
:members:

`ViT`
~~~~~
.. autoclass:: ViT
Expand Down Expand Up @@ -723,6 +771,39 @@ Nets

.. autoclass:: voxelmorph

`VQ-VAE`
~~~~~~~~
.. autoclass:: VQVAE
:members:

`PatchGANDiscriminator`
~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: PatchDiscriminator
:members:

.. autoclass:: MultiScalePatchDiscriminator
:members:

Diffusion Schedulers
--------------------
.. autoclass:: monai.networks.schedulers.Scheduler
:members:

`DDPM Scheduler`
~~~~~~~~~~~~~~~~
.. autoclass:: monai.networks.schedulers.DDPMScheduler
:members:

`DDIM Scheduler`
~~~~~~~~~~~~~~~~
.. autoclass:: monai.networks.schedulers.DDIMScheduler
:members:

`PNDM Scheduler`
~~~~~~~~~~~~~~~~
.. autoclass:: monai.networks.schedulers.PNDMScheduler
:members:

Utilities
---------
.. automodule:: monai.networks.utils
Expand Down
5 changes: 5 additions & 0 deletions docs/source/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ Component store
---------------
.. autoclass:: monai.utils.component_store.ComponentStore
:members:

Ordering
--------
.. automodule:: monai.utils.ordering
:members:
Loading