Skip to content

Fix sign-compare warning in reorder_array#869

Merged
hwu36 merged 1 commit intoNVIDIA:masterfrom
malfet:patch-1
Mar 20, 2023
Merged

Fix sign-compare warning in reorder_array#869
hwu36 merged 1 commit intoNVIDIA:masterfrom
malfet:patch-1

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Mar 14, 2023

std::vector<T>::size_type is unsigned type, so let's iterate over unsigned type as well

Discovered, while trying to enable PyTorch building without -Wno-sign-compare warning suppression, see https://github.com/pytorch/pytorch/actions/runs/4418987999/jobs/7746850762#step:10:10532

`std::vector<T>::size_type` is unsigned type, so let's iterate over unsigned type as well


Discovered, while trying to enable PyTorch building without `-Wno-sign-compare` warning suppression, see https://github.com/pytorch/pytorch/actions/runs/4418987999/jobs/7746850762#step:10:10532
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Mar 15, 2023
Number of OSS PR were reverted, because new signed-unsigned comparison warnings, which are treated as errors in some internal builds.
Not sure how those selective rules are applied, but this PR removes `-Wno-sign-compare` from PyTorch codebase.

The only tricky part in this PR, as making sure that non-ASCII character detection works for both signed and unsigned chars  here:
https://github.com/pytorch/pytorch/blob/6e3d51b08ac108b27d892ab1be85eeb593ec1f0c/torch/csrc/jit/serialization/python_print.cpp#L926

Exclude several files from sign-compare if flash attention is used, due to the violation in cutlass, to be fixed by NVIDIA/cutlass#869
Do not try to fix sign compare violations in caffe2 codebase
Pull Request resolved: #96723
Approved by: https://github.com/albanD
@hwu36 hwu36 merged commit 2670b97 into NVIDIA:master Mar 20, 2023
@malfet malfet deleted the patch-1 branch March 20, 2023 21:14
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 23, 2023
Number of OSS PR were reverted, because new signed-unsigned comparison warnings, which are treated as errors in some internal builds.
Not sure how those selective rules are applied, but this PR removes `-Wno-sign-compare` from PyTorch codebase.

The only tricky part in this PR, as making sure that non-ASCII character detection works for both signed and unsigned chars  here:
https://github.com/pytorch/pytorch/blob/6e3d51b08ac108b27d892ab1be85eeb593ec1f0c/torch/csrc/jit/serialization/python_print.cpp#L926

Exclude several files from sign-compare if flash attention is used, due to the violation in cutlass, to be fixed by NVIDIA/cutlass#869
Do not try to fix sign compare violations in caffe2 codebase
Pull Request resolved: pytorch/pytorch#96723
Approved by: https://github.com/albanD
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 27, 2023
Number of OSS PR were reverted, because new signed-unsigned comparison warnings, which are treated as errors in some internal builds.
Not sure how those selective rules are applied, but this PR removes `-Wno-sign-compare` from PyTorch codebase.

The only tricky part in this PR, as making sure that non-ASCII character detection works for both signed and unsigned chars  here:
https://github.com/pytorch/pytorch/blob/6e3d51b08ac108b27d892ab1be85eeb593ec1f0c/torch/csrc/jit/serialization/python_print.cpp#L926

Exclude several files from sign-compare if flash attention is used, due to the violation in cutlass, to be fixed by NVIDIA/cutlass#869
Do not try to fix sign compare violations in caffe2 codebase
Pull Request resolved: pytorch/pytorch#96723
Approved by: https://github.com/albanD
andralex pushed a commit to andralex/cutlass that referenced this pull request Jun 14, 2025
`std::vector<T>::size_type` is unsigned type, so let's iterate over unsigned type as well


Discovered, while trying to enable PyTorch building without `-Wno-sign-compare` warning suppression, see https://github.com/pytorch/pytorch/actions/runs/4418987999/jobs/7746850762#step:10:10532
Albresky pushed a commit to Albresky/cutlass that referenced this pull request Oct 11, 2025
`std::vector<T>::size_type` is unsigned type, so let's iterate over unsigned type as well


Discovered, while trying to enable PyTorch building without `-Wno-sign-compare` warning suppression, see https://github.com/pytorch/pytorch/actions/runs/4418987999/jobs/7746850762#step:10:10532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants