Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/actions/workflow-build/build-workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ def process_job_array(group_name, array_name, parent_json):
)
}

runner_heading = f"🏃 Runner counts (total jobs: {total_jobs})"
runner_heading = f"🏃 Runner counts (total jobs: {total_jobs})"

runner_counts_table = f"| {'#':^4} | Runner\n"
runner_counts_table += "|------|------\n"
Expand Down
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ repos:
"python/cuda_cccl/cuda/compute/"]
pass_filenames: false

- repo: https://github.com/sirosen/texthooks
rev: 0.7.1
hooks:
- id: fix-smartquotes
- id: fix-spaces
- id: forbid-bidi-controls
- id: fix-ligatures

- repo: local
hooks:
- id: check-shebang
Expand All @@ -106,5 +114,15 @@ repos:
^.*libcudacxx/cmake/config\.guess$
)

- id: unprintable-unicode
name: unprintable-unicode
entry: ci/util/pre-commit/strip_unprintable.bash
language: unsupported_script
types: [text]
exclude: |
(?x)^(
^.*ci/util/pre-commit/strip_unprintable\.bash$
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.

default_language_version:
python: python3
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ CCCL's CI is built on GitHub Actions and relies on a dynamically generated job m
* Declares build and test jobs for `pull_request`, `nightly`, and `weekly` workflows.
* Pull request (PR) runs typically spawn ~250 jobs.
* To reduce overhead, you can add an override matrix in `workflows.override`. This limits the PR CI run to a targeted subset of jobs. Overrides are recommended when:
* Changes touch high-dependency areas (e.g. top-level CI/devcontainers, libcudacxx, thrust, CUB). See `ci/inspect_changes.py` for dependency information.
* Changes touch high-dependency areas (e.g. top-level CI/devcontainers, libcudacxx, thrust, CUB). See `ci/inspect_changes.py` for dependency information.
* A smaller subset of jobs is enough to validate the change (e.g. infra changes, targeted fixes).
* Important rules:
* PR merges are blocked while an override matrix is active.
Expand Down
100 changes: 100 additions & 0 deletions ci/util/pre-commit/strip_unprintable.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/env bash
#
# strip_unprintable.bash - Remove invisible / unprintable characters from text files.

set -euo pipefail

PROG=$(basename "$0")

# Canonical definition of what gets removed. One row per range group:
# <perl character-class fragment> <tab> <human description>
# The Perl class and the --help listing are both derived from this table, so
# adding or removing a range only needs to happen here.
ranges() {
printf '%s\t%s\n' \
'\x{0000}-\x{0008}\x{000B}\x{000C}\x{000E}-\x{001F}\x{007F}' 'C0 controls / DEL (TAB, LF, CR preserved)' \
'\x{0080}-\x{009F}' 'C1 controls' \
'\x{00A0}' 'no-break space' \
'\x{200B}-\x{200F}' 'zero-width space/joiners, bidi marks' \
'\x{202A}-\x{202E}' 'bidi embedding/override' \
'\x{2060}-\x{2064}' 'word joiner, invisible operators' \
'\x{FEFF}' 'BOM / zero-width no-break space'
}

# Perl character class assembled from column 1 of the ranges table.
BAD_CLASS="[$(ranges | cut -f1 | tr -d '\n')]"
PERL="${PERL:-perl}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to assume that all developer systems have perl installed? Should there be a fallback (like skipping the check) if perl isn't installed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly if you have multiple perls installed (e.g. one from system and one from package manager). I seriously doubt this would be needed often, but I always like to provide such escape hatches for the "main" driver utils of scripts so that users can just do e.g.

PYTHON=/my/python AWK=/my/awk PERL=/my/perl script.bash


usage() {
cat <<EOF
Usage: ${PROG} [--check] FILE [FILE...]

Remove invisible / unprintable characters from text files, in place, while
preserving ordinary whitespace (TAB U+0009, LF U+000A, CR U+000D).

Options:
--check Report offending files and their line/column locations; make no
edits. Exits non-zero if any unprintable characters are found.
-h, --help Show this help and exit.

Removed characters:
$(ranges | sed 's/^/ /')
EOF
}

check_only=0

# Parse options. Stop at the first non-option; everything after is a file.
while [[ $# -gt 0 ]]; do
case "${1}" in
-h | --help)
usage
exit 0
;;
--check)
check_only=1
shift
;;
--)
shift
break
;;
-*)
echo "error: unknown option: ${1}" >&2
usage >&2
exit 2
;;
*)
break
;;
esac
done

if [[ $# -eq 0 ]]; then
echo "error: no files given" >&2
usage >&2
exit 2
fi

status=0
# Both modes process every file in a single perl process to avoid per-file interpreter
# startup overhead. In --check mode, `close ARGV if eof` resets the line counter ($.) at
# each file boundary so reported line numbers are per-file.
if [[ ${check_only} -eq 1 ]]; then
# $cls/$ARGV/$./$& are Perl variables and must stay literal inside the single quotes;
# only BAD_CLASS is interpolated, via the deliberate quote break-out.
#
# shellcheck disable=SC2016
${PERL} -CSD -ne '
BEGIN { $cls = qr/'"${BAD_CLASS}"'/; }
while (/$cls/g) {
printf "%s:%d:%d: U+%04X\n", $ARGV, $., pos() - length($&) + 1, ord($&);
$found = 1;
}
close ARGV if eof;
END { exit($found ? 1 : 0); }
' "$@" || status=1
exit "${status}"
fi
Comment thread
Jacobfaib marked this conversation as resolved.

${PERL} -CSD -i -pe 's/'"${BAD_CLASS}"'//g' "$@"
2 changes: 1 addition & 1 deletion ci/windows/build_common.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param(
Param(
[Parameter(Mandatory = $false)]
[Alias("std")]
[ValidateNotNullOrEmpty()]
Expand Down
8 changes: 4 additions & 4 deletions ci/windows/build_cuda_cccl_python.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
When set, only that version is built and the *merge* step is skipped.

.PARAMETER Cuda13Image
Optional. The Docker image name used for a nested build of the CUDA13
wheel when the outer container defaults to CUDA12.9. The default value
Optional. The Docker image name used for a nested build of the CUDA 13
wheel when the outer container defaults to CUDA 12.9. The default value
matches the RAPIDS dev‑container image that contains the required
toolchain: `rapidsai/devcontainers:26.06-cuda13.0-cl14.44-windows2022`.

Expand All @@ -39,7 +39,7 @@
Action.

.EXAMPLE
# Build a single cuda-cccl wheel for Python3.13 (consisting of both CUDA
# Build a single cuda-cccl wheel for Python 3.13 (consisting of both CUDA
Comment thread
Jacobfaib marked this conversation as resolved.
# 12 and 13 versions), and, if in CI, upload the resulting wheel as an
# artifact.
.\build_cuda_cccl_python.ps1 -PyVersion 3.11
Expand Down Expand Up @@ -155,7 +155,7 @@ ${null} = New-Item -ItemType Directory -Path (Join-Path $RepoRoot 'wheelhouse_cu
function Invoke-Cuda13NestedBuild {
<#
.SYNOPSIS
Run the nested Docker build for CUDA13 when we are already inside a
Run the nested Docker build for CUDA 13 when we are already inside a
CUDA 12 builder image.

.DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion ci/windows/run_cpu_bisect.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param(
Param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$PassthroughArgs
)
Expand Down
2 changes: 1 addition & 1 deletion ci/windows/run_cpu_target.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param(
Param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$PassthroughArgs
)
Expand Down
2 changes: 1 addition & 1 deletion ci/windows/run_gpu_bisect.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param(
Param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$PassthroughArgs
)
Expand Down
2 changes: 1 addition & 1 deletion ci/windows/run_gpu_target.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param(
Param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$PassthroughArgs
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ inline event_list task::acquire(backend_ctx_untyped& ctx)
result.merge(ctx.get_start_events());
}

// @@@@ TODO@@@@ explain this algorithm, and why we need to go in reversed
// @@@@ TODO@@@@ explain this algorithm, and why we need to go in reversed
// order because we skipped equivalent dependencies that were stored
// contiguously after sorting.
instance_id_t previous_instance_id = instance_id_t::invalid;
Expand All @@ -193,7 +193,7 @@ inline event_list task::acquire(backend_ctx_untyped& ctx)
else
{
assert(previous_instance_id != instance_id_t::invalid);
// @@@@ TODO @@@@ make a unit test to make sure we have the same instance id for different acquired_data
// @@@@ TODO @@@@ make a unit test to make sure we have the same instance id for different acquired_data
// ? fprintf(stderr, "SETTING SKIPPED INSTANCE ID ... %d\n", previous_instance_id);
it->set_instance_id(previous_instance_id);
}
Expand Down
2 changes: 1 addition & 1 deletion cudax/test/stf/examples/05-stencil-no-copy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using namespace cuda::experimental::stf;

/*
* DATA BLOCKS
* | GHOSTS | DATA | GHOSTS |
* | GHOSTS | DATA | GHOSTS |
*/
template <typename T>
class data_block
Expand Down
2 changes: 1 addition & 1 deletion cudax/test/stf/examples/05-stencil.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static stream_ctx ctx;

/*
* DATA BLOCKS
* | GHOSTS | DATA | GHOSTS |
* | GHOSTS | DATA | GHOSTS |
*/
template <typename T>
class data_block
Expand Down
2 changes: 1 addition & 1 deletion cudax/test/stf/stencil/stencil-1D.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static graph_ctx ctx;

/*
* DATA BLOCKS
* | GHOSTS | DATA | GHOSTS |
* | GHOSTS | DATA | GHOSTS |
*/
template <typename T>
class data_block
Expand Down
4 changes: 2 additions & 2 deletions docs/cub/tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ since the names of the reported parameters in the variant are derived from these
The variant ``ipt_19.tpb_512``, which stands for 19 items per thread (``ipt``) and 512 threads per block (``tpb``),
was thus compiled with ``-DTUNE_ITEMS_PER_THREAD=19 -DTUNE_THREADS_PER_BLOCK=512``.
The meaning of these values is specific to the benchmark definition,
and we have to check the benchmarks source code for how they are applied.
and we have to check the benchmark's source code for how they are applied.
Equally named tuning parameters may not translate to different benchmarks (please double check).

As a user of CUB, such a new set of tuning parameters (i.e. a variant) can then be used to define a policy selector,
Expand All @@ -561,7 +561,7 @@ as :ref:`sketched above <cub-tuning-authoring-benchmarks>`:
}
};

The default tunings defined inside CUBs source use the same infrastructure
The default tunings defined inside CUB's source use the same infrastructure
but should only be changed and extended by the CCCL maintainers.
All default tunings are found in the :code:`cub/device/detail/tuning/tuning_*.cuh` headers, organized by algorithm.
CUB's policy selectors are highly parameterized on type information and traits of the input arguments to CUB algorithms
Expand Down
Loading
Loading