-
Notifications
You must be signed in to change notification settings - Fork 79
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
vectorize-pr #856
Open
ipdemes
wants to merge
88
commits into
nv-legate:branch-24.03
Choose a base branch
from
ipdemes:vectorize
base: branch-24.03
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
vectorize-pr #856
Changes from 84 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
e7f6efd
towards using vectorize
ipdemes 02b5ffc
making simple test work on CPUs
ipdemes 8b8e601
making simple GPU function work
ipdemes d330016
changing isort version in pre-commmit due to some errors in the older…
ipdemes 6199a41
adding type stubs for numba
ipdemes 23b80c5
clean-up
ipdemes 3e07363
forcing partition by the first dimention for vectorize
ipdemes 67b5675
adding caching to vectorize
ipdemes 5b634fb
adding support for otypes
ipdemes 844a29f
requiring exact instance creation for EVAL_UDF task
ipdemes 7285498
fixing logic for generating CPU functions
ipdemes f1192e6
some clean-up
ipdemes e8b544f
adding logic for scalar arguments
ipdemes 37a7281
refactoring cectorize kernel to compute point
ipdemes 024e943
making GPU kernel work with sparse arrays
ipdemes 24b16c3
some clean-up
ipdemes c76b2fe
hashing CUDA kernel for user function
ipdemes c8e8847
removing PTX from task arguments in the case the function was hashed
ipdemes 392b4ee
fixing Torchswe test
ipdemes 4278be6
fixing Torchswe test
ipdemes ff0782b
fixing Torchswe test
ipdemes c772522
adding debug output
ipdemes 958a7b8
adding debug output
ipdemes 1f35532
removing debug output
ipdemes 63265c3
do not pass string if PTX is hashed
ipdemes 798289f
split Cuda kerenel generation with kernel execution
ipdemes 6dbc77a
Merge remote-tracking branch 'origin/branch-23.03' into vectorize
ipdemes 591fe8e
fixing errors after merge
ipdemes 7b56a5c
fixing logic for generating numba function
ipdemes 57bc2b3
adding support for upper-case Letters in argument names in UDF
ipdemes cd6d025
fixing CUfunction caching logic
ipdemes c7b9a08
adding debug output
ipdemes 295bf45
adding explicit omp version for createCuKernel
ipdemes 97949bf
Merge remote-tracking branch 'origin/branch-23.03' into vectorize
ipdemes 3f8a307
changing the way we store CUfunctions
ipdemes fd060d1
refactoring GPU caching
ipdemes 8557a3d
Merge remote-tracking branch 'origin/branch-23.03' into vectorize
ipdemes 113dee7
moving map to store CUfunctions to cudalibs.h
ipdemes 074535e
Merge remote-tracking branch 'origin/branch-23.03' into vectorize
ipdemes 42b8277
fixing dependency between creation and use of UDF function
ipdemes d8caf5f
fixing dependency between creation and use of UDF function
ipdemes cfdf8eb
futures do not add dependency between tasks
ipdemes 8846242
some clean-up
ipdemes 6e8975f
fixed dependency bug
ipdemes 1c3ce9e
more clean-up
ipdemes 5a5b061
removing created_array
ipdemes a80c128
fixing barrier
ipdemes e45d037
removing scipy
ipdemes 30e01c1
Merge remote-tracking branch 'origin/branch-23.05' into vectorize
ipdemes dafbf1d
adding provenance
ipdemes 9e09b8b
adding black_scholes example that uses vectorize
ipdemes 9cd491a
removing special cases from black_scholes_greek
ipdemes 0c2f9cd
cleaning up greeks test
ipdemes d6311ab
Merge remote-tracking branch 'origin/branch-23.05' into vectorize
ipdemes f6b8e67
making CPU UDF work with sparse arrays
ipdemes f3a704d
removed unused argument
ipdemes ac074fe
code clean-up and formatting
ipdemes 99446de
some fixes for empty functions
ipdemes 725e223
parsing python function for return arguments
ipdemes 905fa95
removing dependency on six and some clean-up
ipdemes 9bdefe9
updates for docs
bryevdv c0278f7
adding logic for parsing returns from UDF
ipdemes f6c5155
making vectorize to return arrays
ipdemes 0924e4f
adding more tests + code clean-up
ipdemes 00b39c4
fixing logic for caching
ipdemes e7e4e7a
adding more tests
ipdemes fe5219a
formatting
ipdemes 7901dd8
Merge branch 'vectorize' of github.com:ipdemes/cunumeric into vectorize
ipdemes 5b75297
small bugfux
ipdemes 09b755f
clean-up + formatting
ipdemes 22b217e
Merge remote-tracking branch 'origin/branch-23.05' into vectorize
ipdemes 393aa1b
clean-up + formatting
ipdemes c8dd7fa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 92170ff
Update cunumeric/vectorize.py
ipdemes a3196b4
addressing comments from Bryan
ipdemes fb7853e
making strings more readable
ipdemes f62ed37
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2762123
replacing strings with f-strings
ipdemes d16c2b2
Merge branch 'vectorize' of github.com:ipdemes/cunumeric into vectorize
ipdemes 0a0650c
arguments should be a copy of arrays to match the numpy logic
ipdemes 98f15d6
adding missing type stubs for numpy
ipdemes 8d118ca
checking return statememt of UDF for special characters
ipdemes 889fb65
updating the map between pyarow types and legate types
ipdemes 7df88a4
adding type stubs for pyarrow
ipdemes a65eea1
Update cunumeric/vectorize.py
ipdemes 4dc584b
addressing comments from Bryan
ipdemes 0446909
Merge remote-tracking branch 'origin/branch-23.07' into vectorize
ipdemes c123d63
fixed some typos
ipdemes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -22,6 +22,7 @@ | |||||||||||||||||
|
||||||||||||||||||
import legate.core.types as ty | ||||||||||||||||||
import numpy as np | ||||||||||||||||||
import pyarrow as pa | ||||||||||||||||||
|
||||||||||||||||||
from .types import NdShape | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -43,6 +44,26 @@ | |||||||||||||||||
np.float64: ty.float64, | ||||||||||||||||||
np.complex64: ty.complex64, | ||||||||||||||||||
np.complex128: ty.complex128, | ||||||||||||||||||
complex: ty.complex128, | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
CUNUMERIC_TYPE_MAP = { | ||||||||||||||||||
bool: ty.bool_, | ||||||||||||||||||
int: ty.int64, | ||||||||||||||||||
float: ty.float64, | ||||||||||||||||||
complex: ty.complex128, | ||||||||||||||||||
pa.bool_: ty.bool_, | ||||||||||||||||||
pa.int8: ty.int8, | ||||||||||||||||||
pa.int16: ty.int16, | ||||||||||||||||||
pa.int32: ty.int32, | ||||||||||||||||||
pa.int64: ty.int64, # np.int is int | ||||||||||||||||||
pa.uint8: ty.uint8, | ||||||||||||||||||
pa.uint16: ty.uint16, | ||||||||||||||||||
pa.uint32: ty.uint32, | ||||||||||||||||||
pa.uint64: ty.uint64, # np.uint is np.uint64 | ||||||||||||||||||
pa.float16: ty.float16, | ||||||||||||||||||
pa.float32: ty.float32, | ||||||||||||||||||
pa.float64: ty.float64, | ||||||||||||||||||
} | ||||||||||||||||||
manopapad marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
|
@@ -99,6 +120,12 @@ def is_supported_dtype(dtype: Any) -> bool: | |||||||||||||||||
return dtype.type in SUPPORTED_DTYPES | ||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
def convert_to_cunumeric_dtype(dtype: Any) -> Any: | ||||||||||||||||||
if dtype in CUNUMERIC_TYPE_MAP: | ||||||||||||||||||
return CUNUMERIC_TYPE_MAP[dtype] | ||||||||||||||||||
raise TypeError("dtype is not supported") | ||||||||||||||||||
Comment on lines
+117
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
def calculate_volume(shape: NdShape) -> int: | ||||||||||||||||||
if len(shape) == 0: | ||||||||||||||||||
return 0 | ||||||||||||||||||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python-level arithmetic values can only be bool/int/float/complex. You'll probably also need to remove the
import pyarrow
at the top.