-
Notifications
You must be signed in to change notification settings - Fork 65
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
Unwrapping arguments passed from R #454
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… it would be nice to make it full c++ in the future.
…or-argument-wrapping
…or-argument-wrapping
dfalbel
force-pushed
the
refactor-argument-wrapping
branch
from
February 4, 2021 12:18
4d411ef
to
6c77fe7
Compare
dfalbel
added
the
lantern
Use this label if your PR affects lantern so it's built in the CI
label
Feb 4, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows unwrapping arguments from R without using autogenerated code.
This will eventually allow us to remove the
argument_to_torch
function that is the main overhead when calling torch functions.torch/R/codegen-utils.R
Lines 34 to 169 in 480a011
TODO:
obj
inargument_to_torch_type
.This allows us to gain some speedups, specially with small models where the R overhead can be significatnly larger.
A simple benchmark gives us 37% speedup for small ops:
CRAN torch:
This PR:
This PR also allows us to rewrite the dispatcher in C++ in the future.