Skip to content

Conversation

@avik-pal
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2025

Your PR no longer requires formatting changes. Thank you for your contribution!

@codecov
Copy link

codecov bot commented May 28, 2025

Codecov Report

Attention: Patch coverage is 43.47826% with 26 lines in your changes missing coverage. Please review.

Project coverage is 75.18%. Comparing base (037dfed) to head (6cbf2c0).
Report is 402 commits behind head on main.

Files with missing lines Patch % Lines
src/sugar.jl 46.66% 16 Missing ⚠️
ext/EnzymeGPUArraysCoreExt.jl 0.00% 8 Missing ⚠️
ext/EnzymeStaticArraysExt.jl 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2421      +/-   ##
==========================================
+ Coverage   67.50%   75.18%   +7.67%     
==========================================
  Files          31       56      +25     
  Lines       12668    16971    +4303     
==========================================
+ Hits         8552    12759    +4207     
- Misses       4116     4212      +96     

☔ View full report in Codecov by Sentry.
📢 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.

@avik-pal avik-pal force-pushed the ap/stacked_onehot branch from 1c09896 to 6cbf2c0 Compare May 28, 2025 16:03
@avik-pal
Copy link
Collaborator Author

cc @wsmoses for a review

return res
end
stacked isa Val{false} && return ret
return stack(ret)
Copy link
Member

Choose a reason for hiding this comment

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

we shold use a different implementation here. allocate a zero array of the whole size then just selectively set the one's in the identity (alternatively, is there already an eye or similar function we could use)

Copy link
Collaborator Author

@avik-pal avik-pal May 30, 2025

Choose a reason for hiding this comment

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

something like mapslices(Base.Fix2(copyto!, I), x; dims=(1, 2)) (with inpalce and stuff) and then reshape. I am just unsure what that whole onehot_internal function above does.

If we make it a proper arg I can leave these ones unchanged

@allowscalar @inbounds res[i + start - 1] = 1
return res
end
stacked isa Val{false} && return ret
Copy link
Member

Choose a reason for hiding this comment

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

similar comment


@inline function Enzyme.onehot(x::StaticArrays.SArray{S, T, N, L}) where {S, T, N, L}
ntuple(Val(L)) do i
@inline function Enzyme.onehot(x::StaticArrays.SArray{S, T, N, L}; stacked::Union{Val{true}, Val{false}} = Val(false)) where {S, T, N, L}
Copy link
Member

Choose a reason for hiding this comment

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

I'm also debating if we should make this a proper non kw argument (essentially because while the outer function is marked inline, I don't know a away to make the inner kwfunc inline [and we really do want that here]

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