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

Stop inference of type if dtype is given and manually decode terms where needed #928

Merged
merged 5 commits into from
Jun 14, 2024

Conversation

philss
Copy link
Member

@philss philss commented Jun 13, 2024

This is a continuation of #923

We are now delegating to the backend the job of decoding the terms instead of casting if the dtype is different from the inferred dtype. In fact we stopped to infer the type if the dtype is given.

In a nutshell, this PR:

  1. removes the inference of type if :dtype is given.
  2. stop casting if given dtype and inferred dtype are different, because point 1.
  3. adds a manual decoding of terms for the functions that may accept special values (structs or integers).

The main goal is to improve performance, as discussed in #922.

philss and others added 4 commits June 13, 2024 19:00
The idea is to avoid the need to cast from the Elixir side. This also
enable the usage of mixed data if the dtype is provided (in the next
commit this will be true).
@billylanchantin billylanchantin self-requested a review June 14, 2024 13:30
Copy link
Contributor

@billylanchantin billylanchantin left a comment

Choose a reason for hiding this comment

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

This looks great!

Question: Do we think this test file is now obsolete?

@philss
Copy link
Member Author

philss commented Jun 14, 2024

@billylanchantin Thank you! I don't think that test is obsolete because it is covering the inference algorithm, so I would keep that :D

@philss philss merged commit d10d553 into main Jun 14, 2024
4 checks passed
@philss philss deleted the ps-decode-terms-from-list branch June 14, 2024 15:07
@josevalim josevalim mentioned this pull request Jun 14, 2024
5 tasks
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.

3 participants