feat(training): add lora adapter to Single training method#1
Open
mikael10j wants to merge 30 commits into
Open
feat(training): add lora adapter to Single training method#1mikael10j wants to merge 30 commits into
mikael10j wants to merge 30 commits into
Conversation
…ate tensorboard logging
Co-authored-by: Copilot <copilot@github.com>
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>
…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>
Co-authored-by: Copilot <copilot@github.com>
…config loading in training method Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/