From bfc84eb625aa59a17b0049156c0e52aec6af17e3 Mon Sep 17 00:00:00 2001 From: Marcin Zalewski Date: Sat, 2 Apr 2022 03:13:40 -0700 Subject: [PATCH 1/2] Move up Thrust include (#257) Co-authored-by: Marcin Zalewski --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index d66b3d56b..6b2dae92c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,7 +55,7 @@ LD_FLAGS += -L$(CUTENSOR_PATH)/lib -lcutensor -Wl,-rpath,$(CUTENSOR_PATH)/lib LD_FLAGS += -L$(NCCL_PATH)/lib -lnccl -Wl,-rpath,$(NCCL_PATH)/lib endif NVCC_FLAGS ?= -NVCC_FLAGS += -I. -I$(CUTENSOR_PATH)/include -I$(NCCL_PATH)/include -I$(THRUST_PATH) -Wno-deprecated-declarations +NVCC_FLAGS += -I. -I$(THRUST_PATH) -I$(CUTENSOR_PATH)/include -I$(NCCL_PATH)/include -Wno-deprecated-declarations ifeq ($(strip $(DEBUG)),1) CC_FLAGS += -DDEBUG_CUNUMERIC From cdfd5ba4d156f2986ae042465411a4ba8d1bb016 Mon Sep 17 00:00:00 2001 From: Bryan Van de Ven Date: Mon, 4 Apr 2022 13:24:09 -0700 Subject: [PATCH 2/2] Add user-facing docs for coverage reporting --- .../source/comparison/comparison.rst | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/docs/cunumeric/source/comparison/comparison.rst b/docs/cunumeric/source/comparison/comparison.rst index e18377c9e..cc1de9423 100644 --- a/docs/cunumeric/source/comparison/comparison.rst +++ b/docs/cunumeric/source/comparison/comparison.rst @@ -7,3 +7,68 @@ Here is a list of NumPy APIs and corresponding cuNumeric implementations. We welcome contributions for these functions. .. include:: comparison_table.rst.inc + + +Measuring API coverage +---------------------- + +When running applications that use cunumeric, various command line options may +be used to generate coverage reports. + +Overall coverage report +~~~~~~~~~~~~~~~~~~~~~~~ + +The command line flag ``-cunumeric:report:coverage`` may be added to print an +overall percentage of cunumeric coverage: + +.. code-block:: sh + + legate test.py -cunumeric:report:coverage + +After execution completes, the percentage of NumPy API calls that were handled +by cunumeric is printed: + +.. code-block:: + + cuNumeric API coverage: 26/26 (100.0%) + +Detailed coverage report +~~~~~~~~~~~~~~~~~~~~~~~~ + +The command line flag ``-cunumeric:report:dump-csv`` may be added to save a +detailed coverage report: + +.. code-block:: sh + + legate test.py -cunumeric:report:dump-csv out.csv + +After execution completes, a CSV file will be saved to the specified location +(in this case ``out.csv``). The file shows exactly what NumPy API functions +were called, whether the are implemented by cunumeric, and the location of +the call site: + +.. code-block:: + + function_name,location,implemented + numpy.array,tests/dot.py:27,True + numpy.ndarray.__init__,tests/dot.py:27,True + numpy.array,tests/dot.py:28,True + numpy.ndarray.__init__,tests/dot.py:28,True + numpy.ndarray.dot,tests/dot.py:31,True + numpy.ndarray.__init__,tests/dot.py:31,True + numpy.allclose,tests/dot.py:33,True + numpy.ndarray.__init__,tests/dot.py:33,True + +Call stack reporting +~~~~~~~~~~~~~~~~~~~~ + +The command line flag ``-cunumeric:report:dump-callstack`` may be added to +include full call stack information in a CSV report: + +.. code-block:: sh + + legate test.py -cunumeric:report:dump-callstack -cunumeric:report:dump-csv out.csv + +After execution completes, the CSV output file have full call stack +information in the location column, with individual stack frames separated +by pipe (``|``) characters: