Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

make gather/scatter work with views #546

Merged
merged 5 commits into from
Nov 6, 2023
Merged

make gather/scatter work with views #546

merged 5 commits into from
Nov 6, 2023

Conversation

CarloLucibello
Copy link
Member

@CarloLucibello CarloLucibello commented Oct 24, 2023

Fix CarloLucibello/GraphNeuralNetworks.jl#349

The time of using NNlib, after precompilation, doesn't seem affected on julia 1.9

# BEFORE THIS PR
julia> @time using NNlib
  0.671857 seconds (1.05 M allocations: 70.765 MiB, 2.26% gc time, 4.35% compilation time

# THIS PR
julia> @time using NNlib
  0.680884 seconds (1.05 M allocations: 70.771 MiB, 2.08% gc time, 4.20% compilation time)

@CarloLucibello
Copy link
Member Author

In the last commit I stopped testing Enzyme since tests are broken at the moment. The issue with Enzyme should be fixed in a separate PR and tests restored there.

cc @wsmoses

@ToucheSir
Copy link
Member

Generally LGTM. Do we need to worry about things like non-contiguous views of CuArrays, or are the existing gather/scatter kernels smart enough to work with those?

@wsmoses
Copy link
Contributor

wsmoses commented Oct 25, 2023

@CarloLucibello yeah the last patch bump of Enzyme included new functionality that triggered that, but ironically I think I fixed it yesterday here EnzymeAD/Enzyme.jl#1106. You can alternatively version bound Enzyme around it for the tests [its just the latest patch that has it]. We'll try to make another patch shortly.

@wsmoses
Copy link
Contributor

wsmoses commented Oct 27, 2023

@CarloLucibello we just released a new patch with that fix (which is seemingly the same as yours)?

Mind re-enabling the test and retrying?

@CarloLucibello
Copy link
Member Author

I reinstated the enzyme tests, it's working fine now.

Do we need to worry about things like non-contiguous views of CuArrays, or are the existing gather/scatter kernels smart enough to work with those?

Added a test with non-contiguous views.

test/runtests.jl Outdated
# get(ENV, "NNLIB_TEST_AMDGPU", "false") != "true"
const Test_Enzyme = VERSION <= v"1.10-" && !Sys.iswindows() &&
# TODO Enzyme is not working properly with AMDGPU yet.
get(ENV, "NNLIB_TEST_AMDGPU", "false") != "true"
const Test_Enzyme = false
Copy link
Contributor

Choose a reason for hiding this comment

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

don't you need to also remove this variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

uops

test/runtests.jl Outdated
# get(ENV, "NNLIB_TEST_AMDGPU", "false") != "true"
const Test_Enzyme = VERSION <= v"1.10-" && !Sys.iswindows() &&
# TODO Enzyme is not working properly with AMDGPU yet.
get(ENV, "NNLIB_TEST_AMDGPU", "false") != "true"
const Test_Enzyme = false
Copy link
Member Author

Choose a reason for hiding this comment

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

uops

test/runtests.jl Outdated Show resolved Hide resolved
@CarloLucibello
Copy link
Member Author

Ready to go, need approval

@CarloLucibello CarloLucibello merged commit 8598c08 into master Nov 6, 2023
12 of 14 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.

View arrays on GPU cause scalar indexing error
4 participants