Track: Track1; Team name: LangDiff; Model: AdvDIFFormer - #399
Open
Mullerio wants to merge 1 commit into
Open
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This was referenced Jul 26, 2026
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.
Checklist
Description
This PR adds an implementation of AdvDIFFormer (Advective Diffusion Transformer) from Wu et al., “Supercharging Graph Transformers with Advective Diffusion” https://arxiv.org/abs/2310.06417.
AdvDIFFormer is a PDE inspired graph Transformer derived from the advective diffusion equations. It combines graph-structured propagation with learned non-local interactions.
This PR also adds, as per challenge a example config:
configs/model/graph/advdifformer.yaml
And some unit tests in:
test/nn/backbones/graph/test_advdifformer.py
Testing was run locally:
uv run --no-sync ruff check topobench/nn/backbones/graph/advdifformer.py test/nn/backbones/graph/test_advdifformer.py test/pipeline/test_pipeline.py
uv run --no-sync pytest test/nn/backbones/graph/test_advdifformer.py -q
uv run --no-sync pytest test/pipeline/test_pipeline.py -q
Additional context
The implementation supports both AdvDIFFormer variants: the more scalable AdvDIFFormer-S formulation and the AdvDIFFormer-I (inverse) formulation. For more details, we refer to the original paper.
For AdvDIFFormer-S, the implementation supports batched PyG graphs while keeping global attention graph-local and avoiding building of dense node-to-node attention matrices. Propagation across multiple heads is batched. The normalized graph structure and batch segmentation are prepared once forward and reused across layers. This improved speed in local testing.
Propagation-order projections are accumulated incrementally rather than by materializing a concatenation of all intermediate propagation states. In line with the original implementation, this implemementation supports weighted edges and multi-head propagation. Additionally, it supports optional graph symmetrization, arbitrary PyG batch assignments and layer normalization. These can be configured through the yaml as in the example.