Skip to content

Remove redundant identity multiplications in SCCNN - #396

Merged
flovertiq merged 2 commits into
pyt-team:mainfrom
KathrineOls1:codex/sccnn-remove-identity
Nov 7, 2026
Merged

flovertiq merged 2 commits into
pyt-team:mainfrom
KathrineOls1:codex/sccnn-remove-identity

Conversation

@KathrineOls1

@KathrineOls1 KathrineOls1 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

This change removes three dense identity matrices and seven identity multiplications from SCCNNLayer.forward. Multiplying a signal by an identity matrix is unnecessary, and allocating these matrices adds memory and computation costs that grow with the number of cells in a batch.

The implementation uses the signals directly while preserving the filter layout, learned parameters, and surrounding operations. It also removes the unused node, edge, and triangle counts.

A small regression test isolates the seven identity terms and checks outputs and input/parameter gradients for sc_order=2 and sc_order=3. This is made by ChatGPT (GPT-6 Astra).

Validation:

  • All 5 SCCNN tests passed.
  • Ruff lint and formatting checks passed.
  • Broader library suite: 145 passed; 3 DHGCN tests failed because pyg-lib was unavailable locally.
  • A separate local comparison against the original implementation passed 48 configurations over three Adam updates each, with exact agreement in outputs, losses, gradients, weights, and optimizer state.

This optimization comes from a joint INF319 project by Christina Holthe and Kathrine Nordnes Olsen (at University of Bergen)

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.79%. Comparing base (983d5b2) to head (bc69a38).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
+ Coverage   96.36%   96.79%   +0.42%     
==========================================
  Files          58       58              
  Lines        2092     2090       -2     
==========================================
+ Hits         2016     2023       +7     
+ Misses         76       67       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KathrineOls1 KathrineOls1 changed the title Codex/sccnn remove identity Remove redundant identity multiplications in SCCNN Nov 5, 2026
@flovertiq
flovertiq merged commit 18b3d4c into pyt-team:main Nov 7, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants