Skip to content
Merged
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
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.6
hooks:
- id: clang-format
types_or: [c++, c, cuda]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi]
args: ["--line-length", "160"]
Comment on lines +7 to +18

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.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify black version 26.1.0 exists and check for security issues

# Check PyPI for black versions
curl -s https://pypi.org/pypi/black/json | jq -r '.releases | keys[]' | grep '^26\.1\.0$'

# Get latest version for comparison
echo "=== Latest black version ==="
curl -s https://pypi.org/pypi/black/json | jq -r '.info.version'

# Check for security advisories
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: PIP, package: "black") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Repository: NVIDIA/cudnn-frontend

Length of output: 635


Update the pinned Black pre-commit hook to address the HIGH security advisory.

rev: 26.1.0 exists but falls under a HIGH-severity vulnerability affecting versions < 26.3.1 (“Arbitrary file writes from unsanitized user input in cache file name”); bump rev in .pre-commit-config.yaml to 26.3.1 or later (latest available: 26.5.1).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.pre-commit-config.yaml around lines 7 - 18, The pinned Black pre-commit
hook rev is currently set to "rev: 26.1.0" (under the hook with id: black/name:
black); update that rev to a fixed secure version (e.g., "26.3.1" or preferably
the latest "26.5.1") in .pre-commit-config.yaml so the Black hook no longer uses
a version affected by the HIGH-severity vulnerability.

- id: black-jupyter
name: black-jupyter
description:
"Black: The uncompromising Python code formatter (with Jupyter Notebook support)"
entry: black
language: python
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi, jupyter]
additional_dependencies: [".[jupyter]"]
args: ["--line-length", "160"]
7 changes: 3 additions & 4 deletions include/cudnn_frontend/node/reduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@ class ReductionNode : public NodeCRTP<ReductionNode> {
// 5. Set the optional group offset tensor descriptor
if (Group_offset != attributes.inputs.end() && Group_offset->second != nullptr) {
#if (CUDNN_VERSION >= 92400)
RETURN_CUDNN_FRONTEND_ERROR_IF(
detail::get_backend_version() < 92400,
error_code_t::GRAPH_NOT_SUPPORTED,
"Reduction group_offset is not supported in cudnn version < 9.24.0");
RETURN_CUDNN_FRONTEND_ERROR_IF(detail::get_backend_version() < 92400,
error_code_t::GRAPH_NOT_SUPPORTED,
"Reduction group_offset is not supported in cudnn version < 9.24.0");
auto group_offset_backend_desc = tensors.at(Group_offset->second->get_uid())->get_raw_desc();

_CUDNN_CHECK_CUDNN_ERROR(detail::set_attribute(reduction_operation.get_raw_desc(),
Expand Down
4 changes: 1 addition & 3 deletions test/python/test_matmul_bias_relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ def test_matmul_bias(param_extract, cudnn_handle):
X_gpu = torch.randn(b, s, e, requires_grad=False, device="cuda", dtype=input_type)
W_gpu = torch.randn(1, e, e * 4, requires_grad=False, device="cuda", dtype=input_type)
B_gpu = torch.randn(1, 1, e * 4, requires_grad=False, device="cuda", dtype=input_type)
Y_expected = torch.nn.functional.linear(
X_gpu.float(), W_gpu.squeeze().float().T, bias=B_gpu.squeeze().float()
).to(input_type)
Y_expected = torch.nn.functional.linear(X_gpu.float(), W_gpu.squeeze().float().T, bias=B_gpu.squeeze().float()).to(input_type)

stream = torch.cuda.current_stream().cuda_stream
cudnn.set_stream(handle=cudnn_handle, stream=stream)
Expand Down