Skip to content

Add attention base class - #2212

Open
TillHae wants to merge 13 commits into
ecmwf:developfrom
TillHae:thauer/develop/issue_2130
Open

Add attention base class#2212
TillHae wants to merge 13 commits into
ecmwf:developfrom
TillHae:thauer/develop/issue_2130

Conversation

@TillHae

@TillHae TillHae commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Description

Adds base class for attention mechanism that all other attention classes inherit from.
This avoids duplications as much as possible.

CC @clessig, @csjfwang

Issue Number

Closes #2130

Is this PR a draft? Mark it as draft.

Checklist before asking for review

  • I have performed a self-review of my code
  • My changes comply with basic sanity checks:
    • I have fixed formatting issues with ./scripts/actions.sh lint
    • I have run unit tests with ./scripts/actions.sh unit-test
    • I have documented my code and I have updated the docstrings.
    • I have added unit tests, if relevant
  • I have tried my changes with data and code:
    • I have run the integration tests with ./scripts/actions.sh integration-test
    • (bigger changes) I have run a full training and I have written in the comment the run_id(s): launch-slurm.py --time 60
    • (bigger changes and experiments) I have shared a hegdedoc in the github issue with all the configurations and runs for this experiments
  • I have informed and aligned with people impacted by my change:
    • for config changes: the MatterMost channels and/or a design doc
    • for changes of dependencies: the MatterMost software development channel

@TillHae

TillHae commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

Maybe we should create a separate PR for just ruffing the repository again. The failed cscs/test-single test seems to already fail at creating the environment.

@github-actions github-actions Bot added eval anything related to the model evaluation pipeline model Related to model training or definition (not generic infra) labels Apr 14, 2026
@TillHae

TillHae commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@csjfwang do you have some time in the upcoming weeks to review it? You can ignore all changes that are not in attention.py. They are just due to linting.

@TillHae

TillHae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@clessig is the refactoring of the attention class still needed or do you want to close the issue and PR?

@clessig

clessig commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

@clessig is the refactoring of the attention class still needed or do you want to close the issue and PR?

Yes, that would still be good

@TillHae

TillHae commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Here is the UML-diagram showing how the structure was before and is currently:

attention_before_PR2212

Here is the UML-diagram showing how the structure would be with this PR:

attention_after_PR2212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eval anything related to the model evaluation pipeline model Related to model training or definition (not generic infra)

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Refactor attention code

2 participants