Skip to content

[FEM.Elastic] Remove complex unproductive stiffness matrix data structure#6133

Open
alxbilger wants to merge 3 commits into
sofa-framework:masterfrom
alxbilger:removestiffness
Open

[FEM.Elastic] Remove complex unproductive stiffness matrix data structure#6133
alxbilger wants to merge 3 commits into
sofa-framework:masterfrom
alxbilger:removestiffness

Conversation

@alxbilger
Copy link
Copy Markdown
Contributor

@alxbilger alxbilger commented May 28, 2026

Since #6069, it is suspected that the ElementStiffnessMatrix data structure did not achieve its performance objectives. It was suggested to replace it by a simple matrix, and contain them in a vector.

This new PR applies the suggestion, and removes totally the complex data structure, that is no longer used.

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added pr: enhancement About a possible enhancement pr: status to review To notify reviewers to review this pull-request labels May 28, 2026
@alxbilger alxbilger requested a review from fredroy May 28, 2026 12:41
@fredroy
Copy link
Copy Markdown
Contributor

fredroy commented May 29, 2026

@alxbilger did you run benchmarks on this branch vs master ?
I can do it on macOS and linux if you want. (to compare with #6069)

@fredroy
Copy link
Copy Markdown
Contributor

fredroy commented May 29, 2026

[ci-build][with-all-tests]

@alxbilger
Copy link
Copy Markdown
Contributor Author

@fredroy fredroy force-pushed the removestiffness branch from eacad69 to 52c475c Compare May 31, 2026 22:38
@fredroy
Copy link
Copy Markdown
Contributor

fredroy commented Jun 1, 2026

on macOS on M3Pro ( 12 P + 4E cores)

Configuration Master FPS RemoveStiffness FPS Speedup
Tetra Linear / Parallel / MatrixFree 4.203 5.935 +41.2%
Tetra Linear / Parallel / Assembled 2.346 2.359 +0.5%
Tetra Linear / Sequential / MatrixFree 2.553 4.176 +63.6%
Tetra Linear / Sequential / Assembled 2.339 2.358 +0.8%
Tetra Corotational / Parallel / MatrixFree 4.083 5.826 +42.7%
Tetra Corotational / Parallel / Assembled 2.344 2.356 +0.5%
Tetra Corotational / Sequential / MatrixFree 1.586 3.585 +126.1%
Tetra Corotational / Sequential / Assembled 2.337 2.348 +0.5%
Hexa Linear / Parallel / MatrixFree 5.114 8.540 +67.0%
Hexa Linear / Parallel / Assembled 2.349 2.350 +0.1%
Hexa Linear / Sequential / MatrixFree 3.391 5.286 +55.9%
Hexa Linear / Sequential / Assembled 2.347 2.343 -0.2%
Hexa Corotational / Parallel / MatrixFree 5.130 8.397 +63.7%
Hexa Corotational / Parallel / Assembled 2.347 2.353 +0.2%
Hexa Corotational / Sequential / MatrixFree 3.039 4.836 +59.1%
Hexa Corotational / Sequential / Assembled 2.335 2.344 +0.4%

Linux on i7 13700K ( 8 P + 8E cores)

Configuration Master FPS RemoveStiffness FPS Speedup
Tetra Linear / Parallel / MatrixFree 7.749 7.082 -8.6%
Tetra Linear / Parallel / Assembled 2.643 2.653 +0.4%
Tetra Linear / Sequential / MatrixFree 2.159 2.111 -2.2%
Tetra Linear / Sequential / Assembled 2.626 2.641 +0.6%
Tetra Corotational / Parallel / MatrixFree 7.290 6.616 -9.3%
Tetra Corotational / Parallel / Assembled 2.622 2.639 +0.6%
Tetra Corotational / Sequential / MatrixFree 1.921 1.866 -2.9%
Tetra Corotational / Sequential / Assembled 2.607 2.616 +0.4%
Hexa Linear / Parallel / MatrixFree 11.344 14.027 +23.7%
Hexa Linear / Parallel / Assembled 2.636 2.651 +0.6%
Hexa Linear / Sequential / MatrixFree 2.692 4.563 +69.5%
Hexa Linear / Sequential / Assembled 2.631 2.635 +0.1%
Hexa Corotational / Parallel / MatrixFree 11.314 13.679 +20.9%
Hexa Corotational / Parallel / Assembled 2.640 2.637 -0.1%
Hexa Corotational / Sequential / MatrixFree 2.517 4.283 +70.2%
Hexa Corotational / Sequential / Assembled 2.616 2.626 +0.4%

Those numbers are virtually identical to those in #6069 so I guess we can close it

@fredroy
Copy link
Copy Markdown
Contributor

fredroy commented Jun 1, 2026

By the way: Windows/MSVC 2026 (Core i7-11800H @ 2.30GHz)

Configuration Master FPS RemoveStiffness FPS Speedup
Tetra Linear / Parallel / MatrixFree 2.585 2.952 +14.2%
Tetra Linear / Parallel / Assembled 1.363 1.287 -5.6%
Tetra Linear / Sequential / MatrixFree 1.018 1.161 +14.1%
Tetra Linear / Sequential / Assembled 1.349 1.282 -5.0%
Tetra Corotational / Parallel / MatrixFree 2.294 2.988 +30.3%
Tetra Corotational / Parallel / Assembled 1.240 1.296 +4.6%
Tetra Corotational / Sequential / MatrixFree 0.617 0.781 +26.5%
Tetra Corotational / Sequential / Assembled 1.185 1.262 +6.5%
Hexa Linear / Parallel / MatrixFree 5.113 7.301 +42.8%
Hexa Linear / Parallel / Assembled 1.350 1.394 +3.3%
Hexa Linear / Sequential / MatrixFree 1.713 2.102 +22.7%
Hexa Linear / Sequential / Assembled 1.342 1.385 +3.2%
Hexa Corotational / Parallel / MatrixFree 4.439 6.035 +35.9%
Hexa Corotational / Parallel / Assembled 1.315 1.354 +3.0%
Hexa Corotational / Sequential / MatrixFree 1.315 1.517 +15.4%
Hexa Corotational / Sequential / Assembled 1.298 1.334 +2.8%

@fredroy
Copy link
Copy Markdown
Contributor

fredroy commented Jun 1, 2026

I rebased the CUDA implementation (#6071) on this branch

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

Labels

pr: enhancement About a possible enhancement pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants