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

cuTENSOR: Fix reference to undefined variable #2263

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

lkdvos
Copy link
Contributor

@lkdvos lkdvos commented Feb 11, 2024

This is a small fix about a typo in figuring out the compute_type in the plan_reduction function, having three arguments, while only two tensors are involved.

On a different note, this is never caught in the tests, as reduce! actually determines the compute_type before it creates the plan, and there it is correctly implemented. (This is also true for contract!, permute!, elementwise_binary_exectute! and elementwise_trinary_execute!, but as far as I can tell, these are all correct). I think it could make sense to remove this duplicate code, and just let the plan_**operation** functions be the only place where the compute_type is determined.
I can file a PR for that as well, or update this one, but this is a bit larger of a change so I'd rather get some feedback first.

@maleadt
Copy link
Member

maleadt commented Feb 13, 2024

Thanks for the fix!

I think it could make sense to remove this duplicate code, and just let the plan_**operation** functions be the only place where the compute_type is determined.

Makes sense. Let's merge the immediate fix now, and I'd be happy to take a PR refactoring the remainder 🙂

@maleadt maleadt merged commit 38e28b7 into JuliaGPU:master Feb 13, 2024
1 check passed
@lkdvos lkdvos deleted the reduce-fix branch February 13, 2024 11:48
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.

None yet

2 participants