Skip to content

feat(training): add lora adapter to Single training method#1

Open
mikael10j wants to merge 30 commits into
mainfrom
feat/lora-adapter
Open

feat(training): add lora adapter to Single training method#1
mikael10j wants to merge 30 commits into
mainfrom
feat/lora-adapter

Conversation

@mikael10j

@mikael10j mikael10j commented Apr 3, 2026

Copy link
Copy Markdown

Description

What problem does this change solve?

What issue or task does this change relate to?

Additional notes

As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/

By opening this pull request, I affirm that all authors agree to the Contributor License Agreement.


📚 Documentation preview 📚: https://anemoi-training--1.org.readthedocs.build/en/1/


📚 Documentation preview 📚: https://anemoi-graphs--1.org.readthedocs.build/en/1/


📚 Documentation preview 📚: https://anemoi-models--1.org.readthedocs.build/en/1/

@mikael10j mikael10j changed the title Feat/lora adapter feat: add lora adapter to GraphForecaster Apr 3, 2026
mikael10j and others added 3 commits April 8, 2026 17:46
mikael10j pushed a commit that referenced this pull request Apr 24, 2026
## Description
This fix make the TimeLimit callback working when using multi nodes.

## What problem does this change solve?
Multi nodes compatibility, error was:
```
[2026-04-20 19:14:34,416][anemoi.training.diagnostics.callbacks.stopping][INFO] - Time limit of 1d reached. Stopping training.
...
[rank0]:[E420 19:44:35.569754537 ProcessGroupNCCL.cpp:632] [Rank 0] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=4832284, OpType=ALLREDUCE, NumelIn=1, NumelOut=1, Timeout(ms)=1800000) ran for 1800051 milliseconds before timing out.
[rank0]:[E420 19:44:35.583911258 ProcessGroupNCCL.cpp:2268] [PG ID 0 PG GUID 0(default_pg) Rank 0]  failure detected by watchdog at work sequence id: 4832284 PG status: last enqueued work: 4832284, last completed work: 4832283
[rank0]:[E420 19:44:35.583921274 ProcessGroupNCCL.cpp:670] Stack trace of the failed collective not found, potentially because FlightRecorder is disabled. You can enable it by setting TORCH_NCCL_TRACE_BUFFER_SIZE to a non-zero value.
...
[rank5]:[E420 19:44:36.136978018 ProcessGroupNCCL.cpp:632] [Rank 5] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=4832284, OpType=BROADCAST, NumelIn=1, NumelOut=1, Timeout(ms)=1800000) ran for 1800059 milliseconds before timing out.
[rank5]:[E420 19:44:36.143571715 ProcessGroupNCCL.cpp:2268] [PG ID 0 PG GUID 0(default_pg) Rank 5]  failure detected by watchdog at work sequence id: 4832284 PG status: last enqueued work: 4832284, last completed work: 4832283
[rank5]:[E420 19:44:36.143579107 ProcessGroupNCCL.cpp:670] Stack trace of the failed collective not found, potentially because FlightRecorder is disabled. You can enable it by setting TORCH_NCCL_TRACE_BUFFER_SIZE to a non-zero value.
[rank5]:[E420 19:44:36.143605827 ProcessGroupNCCL.cpp:684] [Rank 5] Some NCCL operations have failed or timed out. Due to the asynchronous nature of CUDA kernels, subsequent GPU operations might run on corrupted/incomplete data.
[rank5]:[E420 19:44:36.143611938 ProcessGroupNCCL.cpp:698] [Rank 5] To avoid data inconsistency, we are taking the entire process down.
[rank5]:[E420 19:44:36.146121906 ProcessGroupNCCL.cpp:1896] [PG ID 0 PG GUID 0(default_pg) Rank 5] Process group watchdog thread terminated with exception: [Rank 5] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=4832284, OpType=BROADCAST, NumelIn=1, NumelOut=1, Timeout(ms)=1800000) ran for 1800059 milliseconds before timing out.
Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:635 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0xd4 (0xffffa62f3ea4 in /nfs/dh1_home_a/momc/anemoi_venv/venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x1f0 (0xffffa70e8b30 in /nfs/dh1_home_a/momc/anemoi_venv/venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: c10d::ProcessGroupNCCL::watchdogHandler() + 0xe80 (0xffffa70ebcd0 in /nfs/dh1_home_a/momc/anemoi_venv/venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame ecmwf#3: c10d::ProcessGroupNCCL::ncclCommWatchdog() + 0x114 (0xffffa70eca74 in /nfs/dh1_home_a/momc/anemoi_venv/venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame ecmwf#4: <unknown function> + 0xf4bbc (0xfffff2dd4bbc in /usr/local/apps/gcc/15.1.0/lib64/libstdc++.so.6)
frame ecmwf#5: <unknown function> + 0x80b40 (0xfffff7730b40 in /lib64/libc.so.6)
frame ecmwf#6: <unknown function> + 0xeb0dc (0xfffff779b0dc in /lib64/libc.so.6)

terminate called after throwing an instance of 'c10::DistBackendError'
...
```


##  Additional notes ##
Tested it on ECMWF HPC with the following setup:
```
resources:
  cpus_per_task: 72
  memory_per_node: 64G
  tasks_per_node: 4
  total_nodes: 1
  training:
    cpu:
      cpus_per_task: 32
      tasks_per_node: 1
    gpu:
      cpus_per_task: 8
      gpus_per_node: 4
      total_nodes: 4
```

***As a contributor to the Anemoi framework, please ensure that your
changes include unit tests, updates to any affected dependencies and
documentation, and have been tested in a parallel setting (i.e., with
multiple GPUs). As a reviewer, you are also responsible for verifying
these aspects and requesting changes if they are not adequately
addressed. For guidelines about those please refer to
https://anemoi.readthedocs.io/en/latest/***

By opening this pull request, I affirm that all authors agree to the
[Contributor License
Agreement.](https://github.com/ecmwf/codex/blob/main/Legal/contributor_license_agreement.md)
Co-authored-by: Copilot <copilot@github.com>
mikael10j and others added 4 commits April 24, 2026 17:22
…import, fix lora type annotation, move torch into type-checking block

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@mikael10j mikael10j changed the title feat: add lora adapter to GraphForecaster feat(training): add lora adapter to GraphForecaster Apr 27, 2026
mikael10j and others added 2 commits April 27, 2026 14:23
Co-authored-by: Copilot <copilot@github.com>
…config loading in training method

Co-authored-by: Copilot <copilot@github.com>
@mikael10j mikael10j changed the title feat(training): add lora adapter to GraphForecaster feat(training): add lora adapter to Single training method Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants