Skip to content

Conversation

zasdfgbnm
Copy link
Collaborator

@zasdfgbnm zasdfgbnm commented Mar 9, 2023

When working on #1900, I find that sometimes expr simplifier will assign the dtype of a value wrongly. This is because expr simplifier is written loosely assuming the dtypes of all Vals are the same. However, because we are putting pointer types into the expression, we need to be more careful, otherwise we will get wrong kernel code like:

__half* ptr1 = threadIdx.x * 128;
__half* ptr2 = ptr1 + 256 + T1.data;

This PR changes all passes in the expr simplifier to let it infer dtype from its inputs.

  • TODO: update all the failing assertCUDAKernel tests😵‍💫😵‍💫😵‍💫😵‍💫

@zasdfgbnm zasdfgbnm changed the title Misc expr simplifier fixes Fix dtype calculation in expr simplifier Mar 11, 2023
@zasdfgbnm zasdfgbnm marked this pull request as ready for review March 11, 2023 03:19
@zasdfgbnm zasdfgbnm changed the base branch from devel to rebase-2567 March 20, 2023 17:00
@zasdfgbnm zasdfgbnm merged commit c3c55a4 into rebase-2567 Mar 20, 2023
@zasdfgbnm zasdfgbnm deleted the misc-expr-simplifier-fixes branch March 20, 2023 17:01
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.

1 participant