Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding stats functions #694

Merged
merged 17 commits into from
Mar 25, 2025
Merged

Adding stats functions #694

merged 17 commits into from
Mar 25, 2025

Conversation

no-dpr
Copy link

@no-dpr no-dpr commented Jan 17, 2025

fixes #574

Implementing size property to lazy tensors to use with stats functions.

Copy link
Collaborator

@willow-ahrens willow-ahrens left a comment

Choose a reason for hiding this comment

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

please rename the field

Copy link
Collaborator

@willow-ahrens willow-ahrens left a comment

Choose a reason for hiding this comment

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

Great work! This is looking good! I've added some comments about packaging. This PR needs some tests as well. You could add tests to interface_tests.jl. Be sure to leave a link to the github issue to document what precisely the tests are testing.

@willow-ahrens
Copy link
Collaborator

Let's also check that the shape of the lazy tensors is always equal to the shape of the returned tensors when in debug mode using an @assert statement in @debug mode here

@willow-ahrens willow-ahrens marked this pull request as ready for review March 25, 2025 15:02
@willow-ahrens willow-ahrens self-requested a review March 25, 2025 15:02
@willow-ahrens willow-ahrens force-pushed the dp/stats branch 3 times, most recently from 4054792 to edcb1ca Compare March 25, 2025 15:28
@willow-ahrens willow-ahrens enabled auto-merge March 25, 2025 15:28
@@ -111,7 +109,8 @@ function remove_reorders(prgm::LogicNode)
if length(idxs2) < length(getfields(arg))
reorder(
aggregate(
nothing, nothing, arg, setdiff(getfields(arg), idxs2)...
overwrite, nothing, arg,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@kylebd99, I found this was necessary to get things to work, and I'm not sure why. The issue was that merge_stats_def would try to evaluate the aggregate function because the original rule to remove isnothing(init) aggregates never matched. I'm just confused about how we never hit this before.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, yeah I don't have a lot of intuition on this one. It seems like the original version should have checked isnothing on op not init. But, I'm quite surprised that it was never firing.

Copy link

codecov bot commented Mar 25, 2025

Codecov Report

Attention: Patch coverage is 74.62687% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/interface/lazy.jl 79.56% 19 Missing ⚠️
src/interface/eager.jl 50.00% 15 Missing ⚠️
Files with missing lines Coverage Δ
src/Finch.jl 94.68% <ø> (ø)
src/Galley/FinchCompat/translate.jl 67.47% <ø> (+0.54%) ⬆️
src/interface/einsum.jl 78.57% <100.00%> (+0.25%) ⬆️
src/interface/eager.jl 70.65% <50.00%> (-8.39%) ⬇️
src/interface/lazy.jl 77.61% <79.56%> (-1.22%) ⬇️

... and 4 files with indirect coverage changes

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

@willow-ahrens willow-ahrens merged commit 0e255a6 into finch-tensor:main Mar 25, 2025
8 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mean, std, and var functions
3 participants