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

[REVIEW][FEA] Port nvtx.pyx to use non-legacy libcudf APIs #4235

Merged
merged 45 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bc16dc8
initial commit for libcudf++ nvtx.pyx
Feb 22, 2020
3afc2a6
initial commit for libcudf++ nvtx.pyx
Feb 22, 2020
cf409c7
style fix and CHANGELOG
Feb 22, 2020
f24d6a4
initial commit for libcudf++ nvtx.pyx
Feb 22, 2020
eb2cbfb
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Feb 26, 2020
a622c3a
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Feb 27, 2020
031f347
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Mar 5, 2020
92cdee2
correct enum handling for nvtx
Mar 5, 2020
eac8fcd
style check
Mar 5, 2020
9a37846
uncommenting special color references
Mar 5, 2020
fe4c688
addressing some of the comments on the PR
Mar 5, 2020
28207e2
style fix
Mar 5, 2020
3e72f38
fumblight through typecasting
Mar 10, 2020
264a45b
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Mar 11, 2020
a0355b6
still fumbling through Enum types for nvtx
Mar 11, 2020
c508a62
More fumbling with nvtx enums
Mar 11, 2020
cad9ea1
nvtx libcudf++ solution
Mar 11, 2020
b8c275d
style fix
Mar 11, 2020
210cecb
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Mar 11, 2020
716370e
adding custom hex support for nvtx
Mar 11, 2020
238e07f
style fix
Mar 11, 2020
a4a9540
style fix
Mar 11, 2020
39c0dcb
updated all instances of python nvtx to use libcudf++ nvtx
Mar 11, 2020
56952f1
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Mar 11, 2020
8ee8954
style fixes
Mar 11, 2020
99e6a3c
hidden legacy nvtx.range_pop
Mar 11, 2020
b895537
Update python/cudf/cudf/_libxx/nvtx.pyx
millerhooks Mar 12, 2020
90c05eb
Update python/cudf/cudf/_libxx/cpp/nvtx.pxd
millerhooks Mar 12, 2020
4beaa06
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Mar 12, 2020
4e3b0d1
moving nvtx utils
Mar 12, 2020
1876d6f
added utilities init.py.
Mar 12, 2020
91621b4
Merge branch 'branch-0.13' into fea-cython-nvtx
millerhooks Mar 12, 2020
b8c1b8e
Update python/cudf/cudf/_libxx/nvtx.pyx
millerhooks Mar 12, 2020
f4f0b4e
nvtx name encoding safety
Mar 12, 2020
b57ff3e
Merge branch 'fea-cython-nvtx' of github.com:millerhooks/cudf into fe…
Mar 12, 2020
52f34db
Merge branch 'branch-0.13' of https://github.com/rapidsai/cudf into f…
Mar 12, 2020
645e88c
style fix
Mar 12, 2020
d0b7f50
utilities directory nvtx file organization
Mar 12, 2020
242dbb9
copyright 2020
Mar 12, 2020
5091225
Update python/cudf/cudf/_libxx/cpp/utilities/nvtx_utils.pxd
millerhooks Mar 13, 2020
edfb90f
Merge branch 'branch-0.13' into fea-cython-nvtx
Mar 17, 2020
366ab78
fix location of underlying type definition
Mar 17, 2020
d36de09
style
Mar 17, 2020
195e544
remove unused utilities from init
Mar 17, 2020
5e7b079
fix bad imports
Mar 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
## New Features

- PR #3577 Add initial dictionary support to column classes
- PR #3917 Add dictionary add_keys function
millerhooks marked this conversation as resolved.
Show resolved Hide resolved
- PR #3777 Add support for dictionary column in gather
- PR #3693 add string support, skipna to scan operation
- PR #3662 Define and implement `shift`.
- PR #3842 ORC writer: add support for column statistics
- PR #3861 Added Series.sum feature for String
- PR #4069 Added cast of numeric columns from/to String
- PR #3681 Add cudf::experimental::boolean_mask_scatter
- PR #4088 Added asString() on ColumnVector in Java that takes a format string
- PR #4040 Add support for n-way merge of sorted tables
- PR #4053 Multi-column quantiles.
- PR #4100 Add set_keys function for dictionary columns
- PR #3894 Add remove_keys functions for dictionary columns
- PR #4107 Add groupby nunique aggregation
- PR #4235 Port nvtx.pyx to use non-legacy libcudf APIs
- PR #4153 Support Dask serialization protocol on cuDF objects
- PR #4127 Add python API for n-way sorted merge (merge_sorted)
- PR #4164 Add Buffer "constructor-kwargs" header
Expand All @@ -37,7 +35,6 @@

## Improvements

- PR #4187 exposed getNativeView method in Java bindings
- PR #3525 build.sh option to disable nvtx
- PR #3748 Optimize hash_partition using shared memory
- PR #3808 Optimize hash_partition using shared memory and cub block scan
Expand All @@ -52,19 +49,15 @@
- PR #3911 Adding null boolean handling for copy_if_else
- PR #4003 Drop old `to_device` utility wrapper function
- PR #4002 Adding to_frame and fix for categorical column issue
- PR #4035 Port NVText tokenize function to libcudf++
- PR #4009 build script update to enable cudf build without installing
- PR #3897 Port cuIO JSON reader to cudf::column types
- PR #4008 Eliminate extra copy in column constructor
- PR #4013 Add cython definition for io readers cudf/io/io_types.hpp
- PR #4028 Port json.pyx to use new libcudf APIs
- PR #4014 ORC/Parquet: add count parameter to stripe/rowgroup-based reader API
- PR #4042 Port cudf/io/functions.hpp to Cython for use in IO bindings
- PR #3880 Add aggregation infrastructure support for reduction
- PR #3880 Add aggregation infrastructure support for cudf::reduce
- PR #4059 Add aggregation infrastructure support for cudf::scan
- PR #4059 Add aggregation infrastructure support for cudf::scan
- PR #4021 Change quantiles signature for clarity.
- PR #4058 Port hash.pyx to use libcudf++ APIs
- PR #4057 Handle offsets in cython Column class
- PR #4045 Reorganize `libxx` directory
- PR #4029 Port stream_compaction.pyx to use libcudf++ APIs
Expand All @@ -90,7 +83,6 @@
- PR #4098 Remove legacy calls from libcudf strings column code
- PR #4044 Port join.pyx to use libcudf++ APIs
- PR #4111 Use `Buffer`'s to serialize `StringColumn`
- PR #4133 Mask cleanup and fixes: use `int32` dtype, ensure 64 byte padding, handle offsets
- PR #4113 Get `len` of `StringColumn`s without `nvstrings`
- PR #4147 Remove workaround for UNKNOWN_NULL_COUNT in contiguous_split.
- PR #4130 Renames in-place `cudf::experimental::fill` to `cudf::experimental::fill_in_place`
Expand Down Expand Up @@ -160,13 +152,9 @@
- PR #4089 Fix dask groupby mutliindex test case issues in join
- PR #4097 Fix strings concatenate logic with column offsets
- PR #4076 All null string entries should have null data buffer
- PR #4145 Support empty index case in DataFrame._from_table
- PR #4109 Use rmm::device_vector instead of thrust::device_vector
- PR #4113 Use `.nvstrings` in `StringColumn.sum(...)`
- PR #4116 Fix a bug in contiguous_split() where tables with mixed column types could corrupt string output
- PR #4108 Fix dtype bugs in dask_cudf metadata (metadata_nonempty overhaul)
- PR #4138 Really fix strings concatenate logic with column offsets
- PR #4119 Fix binary ops slowdown using jitify -remove-unused-globals
- PR #4125 Fix type enum to account for added Dictionary type in `types.hpp`
- PR #4132 Fix `hash_partition` null mask allocation
- PR #4137 Update Java for mutating fill and rolling window changes
Expand Down
1 change: 1 addition & 0 deletions python/cudf/cudf/_libxx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
join,
merge,
null_mask,
nvtx,
orc,
quantiles,
reduce,
Expand Down
32 changes: 32 additions & 0 deletions python/cudf/cudf/_libxx/cpp/nvtx.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2019, NVIDIA CORPORATION.
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved

from libc.stdint cimport uint32_t
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved
millerhooks marked this conversation as resolved.
Show resolved Hide resolved

cdef extern from "cudf/utilities/nvtx_utils.hpp" namespace "cudf::nvtx" nogil:
ctypedef enum _color 'color':
GREEN 'cudf::nvtx::color::GREEN'
BLUE 'cudf::nvtx::color::BLUE'
YELLOW 'cudf::nvtx::color::YELLOW'
PURPLE 'cudf::nvtx::color::PURPLE'
CYAN 'cudf::nvtx::color::CYAN'
RED 'cudf::nvtx::color::RED'
WHITE 'cudf::nvtx::color::WHITE'
DARK_GREEN 'cudf::nvtx::color::DARK_GREEN'
ORANGE 'cudf::nvtx::color::ORANGE'

_color JOIN_COLOR 'cudf::nvtx::JOIN_COLOR'
_color GROUP_COLOR 'cudf::nvtx::GROUP_COLOR'
_color BINARY_OP_COLOR 'cudf::nvtx::BINARY_OP_COLOR'
_color PARTITION_COLOR 'cudf::nvtx::PARTITION_COLOR'
_color READ_CSV_COLOR 'cudf::nvtx::READ_CSV_COLOR'

cdef void range_push(
const char* const name, _color color
) except +

cdef void range_push_hex(
const char* const name,
uint32_t color
) except +

cdef void range_pop() except +
67 changes: 67 additions & 0 deletions python/cudf/cudf/_libxx/nvtx.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright (c) 2020, NVIDIA CORPORATION.

from libc.stdint cimport uint32_t

from cudf._libxx.cpp.nvtx cimport (
range_push as cpp_range_push,
range_push_hex as cpp_range_push_hex,
range_pop as cpp_range_pop,

_color as nvtx_color,
)


def range_push(object name, object color='green'):
"""
Demarcate the beginning of a user-defined NVTX range.

Parameters
----------
name : str
The name of the NVTX range
color : str
The color to use for the range.
Can be named color or hex RGB string.
"""
cdef const char* _name = name
cdef uint32_t _color = color
try:
_color = int(_color, 16)
with nogil:
cpp_range_push_hex(_name, _color)
except ValueError:
if color == 'green':
with nogil:
cpp_range_push(_name, nvtx_color.GREEN)
elif color == 'blue':
with nogil:
cpp_range_push(_name, nvtx_color.BLUE)
elif color == 'yellow':
with nogil:
cpp_range_push(_name, nvtx_color.YELLOW)
elif color == 'purple':
with nogil:
cpp_range_push(_name, nvtx_color.PURPLE)
elif color == 'cyan':
with nogil:
cpp_range_push(_name, nvtx_color.CYAN)
elif color == 'red':
with nogil:
cpp_range_push(_name, nvtx_color.RED)
elif color == 'white':
with nogil:
cpp_range_push(_name, nvtx_color.WHITE)
elif color == 'darkgreen':
with nogil:
cpp_range_push(_name, nvtx_color.DARK_GREEN)
elif color == 'orange':
with nogil:
cpp_range_push(_name, nvtx_color.ORANGE)


def range_pop():
"""
Demarcate the end of a user-defined NVTX range.
"""
with nogil:
cpp_range_pop()