Skip to content

Commit

Permalink
All manual fixes in one commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwgk committed Dec 11, 2024
1 parent d4cc97b commit ea04bda
Show file tree
Hide file tree
Showing 28 changed files with 157 additions and 64 deletions.
7 changes: 3 additions & 4 deletions .github/actions/workflow-build/build-workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ def canonicalize_host_compiler_name(cxx_string):
)

hc_def = matrix_yaml["host_compilers"][id]
hc_versions = hc_def["versions"]

if not version:
version = max(
Expand Down Expand Up @@ -852,10 +851,10 @@ def apply_matrix_job_exclusion(matrix_job, exclusion):
# Some tags are left unexploded (e.g. 'jobs') to optimize scheduling,
# so the values can be either a list or a single value.
# Standardize to a list for comparison:
if type(excluded_values) != list:
if not isinstance(excluded_values, list):
excluded_values = [excluded_values]
matrix_values = matrix_job[tag]
if type(matrix_values) != list:
if not isinstance(matrix_values, list):
matrix_values = [matrix_values]

# Identify excluded values that are present in the matrix job for this tag:
Expand Down Expand Up @@ -1075,7 +1074,7 @@ def parse_workflow_matrix_jobs(args, workflow_name):

if args:
if (
args.dirty_projects != None
args.dirty_projects is not None
): # Explicitly check for None, as an empty list is valid:
matrix_jobs = [
job for job in matrix_jobs if job["project"] in args.dirty_projects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ def get_summary_stats(summary):


def get_summary_heading(summary, walltime):
passed = summary["passed"]
failed = summary["failed"]

if summary["passed"] == 0:
flag = "🟥"
elif summary["failed"] > 0:
Expand Down Expand Up @@ -298,7 +295,6 @@ def get_tag_line(tag, tag_summary):
def get_value_line(value, value_summary, tag_summary):
passed = value_summary["passed"]
failed = value_summary["failed"]
total = passed + failed

parent_size = len(tag_summary["values"])
parent_failed = tag_summary["failed"]
Expand Down Expand Up @@ -372,7 +368,7 @@ def main():
# The timing file is not required.
try:
job_times = json.load(args.job_times)
except:
except Exception:
job_times = None

write_workflow_summary(workflow, job_times)
Expand Down
5 changes: 4 additions & 1 deletion benchmarks/scripts/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ def case_top(alpha, N, algname, ct_point_name, case_dfs):
print("{}[{}]:".format(algname, ct_point_name))

if alpha < 1.0:
case_df = remove_matching_distributions(alpha, case_df)
for subbench in case_dfs:
case_dfs[subbench] = remove_matching_distributions(
alpha, case_dfs[subbench]
)

for subbench in case_dfs:
case_dfs[subbench] = extract_complete_variants(case_dfs[subbench])
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/cccl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import bench
from . import bench as bench
12 changes: 6 additions & 6 deletions benchmarks/scripts/cccl/bench/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .config import *
from .storage import *
from .bench import Bench
from .cmake import CMake
from .score import *
from .search import *
from .config import * # noqa: F403
from .storage import * # noqa: F403
from .bench import Bench as Bench
from .cmake import CMake as CMake
from .score import * # noqa: F403
from .search import * # noqa: F403
6 changes: 3 additions & 3 deletions benchmarks/scripts/cccl/bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import numpy as np

from .cmake import CMake
from .config import *
from .config import BasePoint, Config
from .storage import Storage, get_bench_table_name
from .score import *
from .logger import *
from .score import compute_axes_ids, compute_weight_matrices, get_workload_weight
from .logger import Logger


def first_val(my_dict):
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/cccl/bench/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .build import Build
from .config import Config
from .storage import Storage
from .logger import *
from .logger import Logger


def create_builds_table(conn):
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/scripts/cccl/bench/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

def randomized_cartesian_product(list_of_lists):
length = 1
for l in list_of_lists:
length *= len(l)
for lst in list_of_lists:
length *= len(lst)

visited = set()
while len(visited) < length:
Expand Down
2 changes: 1 addition & 1 deletion cub/benchmarks/docker/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

hpccm.config.set_container_format("docker")

Stage0 += hpccm.primitives.baseimage(image="nvidia/cuda:12.2.0-devel-ubuntu22.04")
Stage0 = hpccm.primitives.baseimage(image="nvidia/cuda:12.2.0-devel-ubuntu22.04")
Stage0 += hpccm.building_blocks.apt_get(
ospackages=[
"git",
Expand Down
3 changes: 1 addition & 2 deletions python/cuda_cooperative/cuda/cooperative/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import cuda.cooperative.experimental
from cuda.cooperative._version import __version__
from cuda.cooperative._version import __version__ as __version__
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from cuda.cooperative.experimental import block, warp
from cuda.cooperative.experimental._types import StatefulFunction
from cuda.cooperative.experimental import block as block
from cuda.cooperative.experimental import warp as warp
from cuda.cooperative.experimental._types import StatefulFunction as StatefulFunction
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from cuda.cooperative.experimental.block._block_merge_sort import merge_sort_keys
from cuda.cooperative.experimental.block._block_reduce import reduce, sum
from cuda.cooperative.experimental.block._block_scan import exclusive_sum
from cuda.cooperative.experimental.block._block_merge_sort import (
merge_sort_keys as merge_sort_keys,
)
from cuda.cooperative.experimental.block._block_reduce import reduce as reduce
from cuda.cooperative.experimental.block._block_reduce import sum as sum
from cuda.cooperative.experimental.block._block_scan import (
exclusive_sum as exclusive_sum,
)
from cuda.cooperative.experimental.block._block_radix_sort import (
radix_sort_keys as radix_sort_keys,
)
from cuda.cooperative.experimental.block._block_radix_sort import (
radix_sort_keys,
radix_sort_keys_descending,
radix_sort_keys_descending as radix_sort_keys_descending,
)
from cuda.cooperative.experimental.block._block_load_store import load, store
from cuda.cooperative.experimental.block._block_load_store import load as load
from cuda.cooperative.experimental.block._block_load_store import store as store
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


from cuda.cooperative.experimental._types import *
import numba

from cuda.cooperative.experimental._types import (
Algorithm,
Dependency,
DependentArray,
DependentPointer,
Invocable,
Pointer,
TemplateParameter,
)
from cuda.cooperative.experimental._common import make_binary_tempfile

CUB_BLOCK_LOAD_ALGOS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import numba
from cuda.cooperative.experimental._types import *

from cuda.cooperative.experimental._types import (
Algorithm,
Constant,
Dependency,
DependentArray,
DependentOperator,
Invocable,
Pointer,
TemplateParameter,
numba_type_to_wrapper,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import numba
from cuda.cooperative.experimental._types import *

from cuda.cooperative.experimental._types import (
Algorithm,
Dependency,
DependentArray,
Invocable,
Pointer,
TemplateParameter,
Value,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from cuda.cooperative.experimental._types import *
import numba

from cuda.cooperative.experimental._types import (
Algorithm,
Dependency,
DependentOperator,
DependentReference,
Invocable,
Pointer,
TemplateParameter,
Value,
numba_type_to_wrapper,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import numba

from cuda.cooperative.experimental._types import *
from cuda.cooperative.experimental._types import (
Algorithm,
Invocable,
Dependency,
DependentArray,
DependentOperator,
Pointer,
TemplateParameter,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from cuda.cooperative.experimental.warp._warp_scan import exclusive_sum
from cuda.cooperative.experimental.warp._warp_reduce import reduce, sum
from cuda.cooperative.experimental.warp._warp_merge_sort import merge_sort_keys
from cuda.cooperative.experimental.warp._warp_scan import exclusive_sum as exclusive_sum
from cuda.cooperative.experimental.warp._warp_reduce import reduce as reduce
from cuda.cooperative.experimental.warp._warp_reduce import sum as sum
from cuda.cooperative.experimental.warp._warp_merge_sort import (
merge_sort_keys as merge_sort_keys,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import numba
from cuda.cooperative.experimental._types import *

from cuda.cooperative.experimental._types import (
Algorithm,
Constant,
Dependency,
DependentArray,
DependentOperator,
Invocable,
Pointer,
TemplateParameter,
numba_type_to_wrapper,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


from cuda.cooperative.experimental._types import *
import numba

from cuda.cooperative.experimental._types import (
Algorithm,
Dependency,
DependentOperator,
DependentReference,
Invocable,
Pointer,
TemplateParameter,
numba_type_to_wrapper,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


from cuda.cooperative.experimental._types import *
import numba

from cuda.cooperative.experimental._types import (
Algorithm,
Dependency,
DependentReference,
Invocable,
Pointer,
TemplateParameter,
)
from cuda.cooperative.experimental._common import make_binary_tempfile


Expand Down
2 changes: 2 additions & 0 deletions python/cuda_cooperative/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
project_path = os.path.abspath(os.path.dirname(__file__))
cccl_path = os.path.abspath(os.path.join(project_path, "..", ".."))
cccl_headers = [["cub", "cub"], ["libcudacxx", "include"], ["thrust", "thrust"]]
__version__ = None
with open(os.path.join(project_path, "cuda", "cooperative", "_version.py")) as f:
exec(f.read())
assert __version__ is not None
ver = __version__
del __version__

Expand Down
1 change: 0 additions & 1 deletion python/cuda_cooperative/tests/test_block_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def output_index(i):

@cuda.jit(link=block_load.files)
def kernel(d_input, d_output):
tid = cuda.threadIdx.x
temp_storage = cuda.shared.array(shape=temp_storage_bytes, dtype="uint8")
thread_data = cuda.local.array(shape=items_per_thread, dtype=dtype)
block_load(temp_storage, d_input, thread_data)
Expand Down
1 change: 0 additions & 1 deletion python/cuda_cooperative/tests/test_block_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def input_index(i):

@cuda.jit(link=block_store.files)
def kernel(d_input, d_output):
tid = cuda.threadIdx.x
temp_storage = cuda.shared.array(shape=temp_storage_bytes, dtype="uint8")
thread_data = cuda.local.array(shape=items_per_thread, dtype=dtype)
for i in range(items_per_thread):
Expand Down
3 changes: 1 addition & 2 deletions python/cuda_parallel/cuda/parallel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import cuda.parallel.experimental
from cuda.parallel._version import __version__
from cuda.parallel._version import __version__ as __version__
2 changes: 0 additions & 2 deletions python/cuda_parallel/cuda/parallel/experimental/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ def CacheModifiedInputIterator(device_array, modifier):

def ConstantIterator(value):
"""Python facade (similar to itertools.repeat) for C++ Random Access ConstantIterator."""
value_type = value.dtype
return _iterators.ConstantIterator(value)


def CountingIterator(offset):
"""Python facade (similar to itertools.count) for C++ Random Access CountingIterator."""
value_type = offset.dtype
return _iterators.CountingIterator(offset)


Expand Down
2 changes: 2 additions & 0 deletions python/cuda_parallel/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
project_path = os.path.abspath(os.path.dirname(__file__))
cccl_path = os.path.abspath(os.path.join(project_path, "..", ".."))
cccl_headers = [["cub", "cub"], ["libcudacxx", "include"], ["thrust", "thrust"]]
__version__ = None
with open(os.path.join(project_path, "cuda", "parallel", "_version.py")) as f:
exec(f.read())
assert __version__ is not None
ver = __version__
del __version__

Expand Down
Loading

0 comments on commit ea04bda

Please sign in to comment.