Skip to content

Add FLOP estimates for operator assembly - #2018

Open
alvaroborras wants to merge 4 commits into
CEED:mainfrom
alvaroborras:flops-estimates-assembly
Open

Add FLOP estimates for operator assembly#2018
alvaroborras wants to merge 4 commits into
CEED:mainfrom
alvaroborras:flops-estimates-assembly

Conversation

@alvaroborras

Copy link
Copy Markdown

Purpose:

Add FLOP estimates for full, diagonal, and point-block diagonal operator assembly. The estimates account for stale QFunction assembly data and report AtPoints assembly as unsupported.

Closes: #1983

LLM/GenAI Disclosure:

Codex was used to brainstorm and review the changes, but the code was written by hand.

By submitting this PR, the author certifies to its contents as described by the Developer's Certificate of Origin.
Please follow the Contributing Guidelines for all PRs.

@jeremylt jeremylt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how I feel about having these tests do two different things instead of one, but their descriptions should be updated

@jeremylt

Copy link
Copy Markdown
Member

it should me possible to estimate at points too

Signed-off-by: alvaroborras <13698600+alvaroborras@users.noreply.github.com>
@alvaroborras
alvaroborras force-pushed the flops-estimates-assembly branch from c2ae795 to 9f46b6c Compare August 29, 2026 17:00
@alvaroborras

alvaroborras commented Aug 29, 2026

Copy link
Copy Markdown
Author

Thanks for the comments, I added some changes around point estimates that I was working on.

Comment thread tests/t526-operator.c Outdated
Comment thread tests/t526-operator.c Outdated
Comment thread tests/t526-operator.c Outdated
Comment thread interface/ceed-preconditioning.c
@jeremylt

Copy link
Copy Markdown
Member

See failing CI jobs - release notes need to be updated, and there's as style fix

Signed-off-by: alvaroborras <13698600+alvaroborras@users.noreply.github.com>
@alvaroborras

Copy link
Copy Markdown
Author

I’ve updated the test descriptions and comments, added the required release-note entry, and applied the style fix.

For AtPoints assembly estimates, CPU backends now count the actual total number of points, while GPU backends keep the max points in element count. I've also added a regression test to cover both cases.

Thank you for the feedback.

Comment thread tests/t595-operator.c Outdated
Comment thread tests/t595-operator.c Outdated
Comment thread tests/t595-operator.c Outdated
Signed-off-by: alvaroborras <13698600+alvaroborras@users.noreply.github.com>
Comment thread CHANGELOG.md Outdated
Comment thread interface/ceed-preconditioning.c Outdated
Comment thread interface/ceed-preconditioning.c Outdated
Comment thread interface/ceed-preconditioning.c Outdated
Comment thread interface/ceed-preconditioning.c
Comment thread interface/ceed-preconditioning.c
Comment thread interface/ceed-preconditioning.c Outdated
@jeremylt

jeremylt commented Sep 1, 2026

Copy link
Copy Markdown
Member

Looking really close, just a couple more small things I noticed

@alvaroborras

Copy link
Copy Markdown
Author

Thanks for the feedback. I’ve updated the release note ordering, reused the existing point count helper, and added the missing documentation.
I believe this should now be ready for another look.

@jeremylt jeremylt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor things, but otherwise looks ready

Comment thread interface/ceed-preconditioning.c Outdated
}

/**
@brief Estimate the FLOPs required to rebuild assembled QFunction data without changing its state

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably say here 'based upon Function rebuild status but does not modify internal state' instead of only 'without changing internal state'

Comment thread interface/ceed-preconditioning.c Outdated
CeedCall(CeedElemRestrictionGetMaxPointsInElement(rstr_points, &max_points));
num_qpts_total = (CeedSize)num_elem * max_points;
} else {
CeedInt num_points;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, probably don't need this intermediate variable, honestly

Document that QFunction FLOP estimates depend on rebuild status without modifying internal state. Reuse the point-count temporary across host and device paths, follow interface error-handling conventions, and keep the CHANGELOG chronological.

Signed-off-by: alvaroborras <13698600+alvaroborras@users.noreply.github.com>
@alvaroborras
alvaroborras force-pushed the flops-estimates-assembly branch from c581f18 to 76da6ea Compare September 6, 2026 11:58
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.

FLOP Estimates for Assembly Kernels

2 participants