Repository navigation
[rocm][7.0/7.2] Fix [[nodiscard]] build errors and BUCK deps across comms, gloo, caffe2 (#176671) - #176671
[rocm][7.0/7.2] Fix [[nodiscard]] build errors and BUCK deps across comms, gloo, caffe2 (#176671)#176671gyllstromk wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176671
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (3 Unrelated Failures)As of commit 8b6c670 with merge base c014085 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
| LOG(ERROR) << #fn << " returned error: " << result; \ | ||
| const char* errMsg = nullptr; \ | ||
| get_nvrtc().cuGetErrorString(result, &errMsg); \ | ||
| (void)get_nvrtc().cuGetErrorString(result, &errMsg); \ |
There was a problem hiding this comment.
This isn't the right fix. This is an actual bug.
| (void)get_nvrtc().cuGetErrorString(result, &errMsg); \ | |
| C10_CUDA_CHECK(get_nvrtc().cuGetErrorString(result, &errMsg)); \ |
is the right fix.
There was a problem hiding this comment.
It seems C10_CUDA_CHECK doesn't work here because it expects cudaError_t (runtime API) while cuGetErrorString returns CUresult (driver API). This causes a compile error on any
CUDA-enabled build:
error: cannot initialize a variable of type 'const cudaError_t' (aka 'const cudaError')
with an rvalue of type 'CUresult' (aka 'cudaError_enum')
C10_CUDA_CHECK expands to const cudaError_t __err = EXPR (https://github.com/pytorch/pytorch/blob/main/c10/cuda/CUDAException.h#L29), but cuGetErrorString returns CUresult
(https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__ERROR.html#group__CUDA__ERROR_1g2c4ac087113652768e1f5ceb4c37be41), so the types are incompatible.
Using (void) is the right fix here — this call is inside the CU_LOG_ERROR error-logging macro (https://github.com/pytorch/pytorch/blob/main/torch/nativert/executor/triton/CudaTritonKernelManager.cpp#L17-L23), so we're already in an
error path. The cuGetErrorString call is just converting the error code to a human-readable string for the log message; there's nothing meaningful to do if that conversion itself fails.
Summary: X-link: pytorch/pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Reviewed By: bbeckca Differential Revision: D93759269
7641f77 to
1547f85
Compare
…omms, gloo, caffe2 (#176671) Summary: ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: Note: full stack used for testing: D95592619. Putting test plan here for clear reproducibility of problem. ```# Build and run the raw SparseSemiStructuredTensor benchmark (NN mode) buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//scripts/gylls/torchao:benchmark_semi_structured_sparsity -- \ --mode nvidia-bert --dtype fp16 --backend cusparselt # TN mode (requires D95099241) CUSPARSELT_FORCE_TN=1 buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//scripts/gylls/torchao:benchmark_semi_structured_sparsity -- \ --mode nvidia-bert --dtype fp16 --backend cusparselt # TorchAO unit tests (11 tests) buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//pytorch/ao/test:torchao_test_sparsity -- \ pytorch.ao.test.sparsity.test_sparse_2x4_cusparselt.TestSparse2x4CuSparseLt # TorchAO benchmark (CuSpLt vs SST vs Dense) buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//pytorch/ao/test:torchao_test_sparsity -- \ pytorch.ao.test.sparsity.test_benchmark_sparse_2x4_cusparselt.TestBenchmarkSparse2x4CuSparseLt `` Reviewed By: bbeckca Differential Revision: D93759269
1547f85 to
9a29ccf
Compare
…omms, gloo, caffe2 (pytorch#176671) Summary: Pull Request resolved: pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: Note: full stack used for testing: D95592619. Putting test plan here for clear reproducibility of problem. ```# Build and run the raw SparseSemiStructuredTensor benchmark (NN mode) buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//scripts/gylls/torchao:benchmark_semi_structured_sparsity -- \ --mode nvidia-bert --dtype fp16 --backend cusparselt # TN mode (requires D95099241) CUSPARSELT_FORCE_TN=1 buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//scripts/gylls/torchao:benchmark_semi_structured_sparsity -- \ --mode nvidia-bert --dtype fp16 --backend cusparselt # TorchAO unit tests (11 tests) buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//pytorch/ao/test:torchao_test_sparsity -- \ pytorch.ao.test.sparsity.test_sparse_2x4_cusparselt.TestSparse2x4CuSparseLt # TorchAO benchmark (CuSpLt vs SST vs Dense) buck2 run mode/opt-amd-gpu -m "fbcode//caffe2:hipsparselt[enabled]" \ fbcode//pytorch/ao/test:torchao_test_sparsity -- \ pytorch.ao.test.sparsity.test_benchmark_sparse_2x4_cusparselt.TestBenchmarkSparse2x4CuSparseLt `` Reviewed By: bbeckca Differential Revision: D93759269
|
@gyllstromk has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93759269. |
Summary: X-link: meta-pytorch/torchcomms#960 X-link: pytorch/pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Reviewed By: bbeckca Differential Revision: D93759269
Skylion007
left a comment
There was a problem hiding this comment.
Not sure clang-format is going to like the out of bound \ at the end of the macro, but otherwise looks good.
Summary: X-link: meta-pytorch/torchcomms#960 X-link: pytorch/pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Reviewed By: bbeckca Differential Revision: D93759269
9a29ccf to
b43b368
Compare
…omms, gloo, caffe2 (#176671) Summary: X-link: pytorch/gloo#494 X-link: meta-pytorch/torchcomms#960 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: ## Reproducing the [[nodiscard]] build errors (ROCm 7.0+) ROCm 7.0 HIP headers annotate CUDA-mapped API functions with `[[nodiscard]]` (e.g. `hipStreamDestroy`, `hipSetDevice`, `hipFree`). With `-Werror` enabled, any call site that discards the return value fails to compile: ``` error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result] cudaSetDevice(device); ^~~~~~~~~~~~~~~~~~~~~~ ``` To reproduce, build any affected target with ROCm >= 7.0. Example using the gloo HIP collectives (which calls `cudaSetDevice` and `cudaDeviceEnablePeerAccess` without checking the return value): ```bash hipcc -std=c++17 -Werror \ -I<pytorch_root> -I<rocm_7.0_path>/include \ -c gloo/cuda_collectives_native.h # → error: ignoring return value ... [-Werror,-Wunused-result] ``` The fix adds `(void)` casts to explicitly discard the return value, which is the standard C++ pattern for suppressing `[[nodiscard]]` warnings. The casts are no-ops on CUDA and older ROCm versions. ## Verification (fbcode, mode/amd-gpu with ROCm 7.0 headers) ```bash # ctran (ibutils.cc, LogInit.cc) buck2 build mode/amd-gpu fbcode//comms/ctran/backends/ib:ib buck2 build mode/amd-gpu fbcode//comms/ctran/utils:utils # rcclx (cudawrap.cc, register.cc, RcclxScubaLogger.h) buck2 build mode/amd-gpu fbcode//comms/rcclx:rcclx-dev # tcp_devmem (batch_unpack_producer.cc, shared_region.cc) buck2 build mode/amd-gpu fbcode//comms/tcp_devmem/unpack:batch_unpack_producer buck2 build mode/amd-gpu fbcode//comms/tcp_devmem/common:common # gloo (cuda_collectives_native.h) buck2 build mode/amd-gpu fbcode//gloo:gloo_gpu_hip ``` All targets build successfully. The BUCK dep fixes for `comms/tcp_devmem/nccl` (nccl-gen, nccl-sim) and `comms/tcp_devmem/unpack` resolve link-time errors that surface when building under ROCm constraints. Reviewed By: bbeckca Differential Revision: D93759269
…e2 (pytorch#494) Summary: X-link: meta-pytorch/torchcomms#960 X-link: pytorch/pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Reviewed By: bbeckca Differential Revision: D93759269
b43b368 to
46325e3
Compare
…omms, gloo, caffe2 (pytorch#176671) Summary: X-link: pytorch/gloo#494 X-link: meta-pytorch/torchcomms#960 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: ## Reproducing the [[nodiscard]] build errors (ROCm 7.0+) ROCm 7.0 HIP headers annotate CUDA-mapped API functions with `[[nodiscard]]` (e.g. `hipStreamDestroy`, `hipSetDevice`, `hipFree`). With `-Werror` enabled, any call site that discards the return value fails to compile: ``` error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result] cudaSetDevice(device); ^~~~~~~~~~~~~~~~~~~~~~ ``` To reproduce, build any affected target with ROCm >= 7.0. Example using the gloo HIP collectives (which calls `cudaSetDevice` and `cudaDeviceEnablePeerAccess` without checking the return value): ```bash hipcc -std=c++17 -Werror \ -I<pytorch_root> -I<rocm_7.0_path>/include \ -c gloo/cuda_collectives_native.h # → error: ignoring return value ... [-Werror,-Wunused-result] ``` The fix adds `(void)` casts to explicitly discard the return value, which is the standard C++ pattern for suppressing `[[nodiscard]]` warnings. The casts are no-ops on CUDA and older ROCm versions. ## Verification (fbcode, mode/amd-gpu with ROCm 7.0 headers) ```bash # ctran (ibutils.cc, LogInit.cc) buck2 build mode/amd-gpu fbcode//comms/ctran/backends/ib:ib buck2 build mode/amd-gpu fbcode//comms/ctran/utils:utils # rcclx (cudawrap.cc, register.cc, RcclxScubaLogger.h) buck2 build mode/amd-gpu fbcode//comms/rcclx:rcclx-dev # tcp_devmem (batch_unpack_producer.cc, shared_region.cc) buck2 build mode/amd-gpu fbcode//comms/tcp_devmem/unpack:batch_unpack_producer buck2 build mode/amd-gpu fbcode//comms/tcp_devmem/common:common # gloo (cuda_collectives_native.h) buck2 build mode/amd-gpu fbcode//gloo:gloo_gpu_hip ``` All targets build successfully. The BUCK dep fixes for `comms/tcp_devmem/nccl` (nccl-gen, nccl-sim) and `comms/tcp_devmem/unpack` resolve link-time errors that surface when building under ROCm constraints. Reviewed By: bbeckca Differential Revision: D93759269
…e2 (pytorch#494) Summary: Pull Request resolved: pytorch#494 X-link: meta-pytorch/torchcomms#960 X-link: pytorch/pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Reviewed By: bbeckca Differential Revision: D93759269
46325e3 to
521ebaf
Compare
…omms, gloo, caffe2 (pytorch#176671) Summary: X-link: pytorch/gloo#494 X-link: meta-pytorch/torchcomms#960 Pull Request resolved: pytorch#176671 ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: ## Reproducing the [[nodiscard]] build errors (ROCm 7.0+) ROCm 7.0 HIP headers annotate CUDA-mapped API functions with `[[nodiscard]]` (e.g. `hipStreamDestroy`, `hipSetDevice`, `hipFree`). With `-Werror` enabled, any call site that discards the return value fails to compile: ``` error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result] cudaSetDevice(device); ^~~~~~~~~~~~~~~~~~~~~~ ``` To reproduce, build any affected target with ROCm >= 7.0. Example using the gloo HIP collectives (which calls `cudaSetDevice` and `cudaDeviceEnablePeerAccess` without checking the return value): ```bash hipcc -std=c++17 -Werror \ -I<pytorch_root> -I<rocm_7.0_path>/include \ -c gloo/cuda_collectives_native.h # → error: ignoring return value ... [-Werror,-Wunused-result] ``` The fix adds `(void)` casts to explicitly discard the return value, which is the standard C++ pattern for suppressing `[[nodiscard]]` warnings. The casts are no-ops on CUDA and older ROCm versions. ## Verification (fbcode, mode/amd-gpu with ROCm 7.0 headers) ```bash # ctran (ibutils.cc, LogInit.cc) buck2 build mode/amd-gpu fbcode//comms/ctran/backends/ib:ib buck2 build mode/amd-gpu fbcode//comms/ctran/utils:utils # rcclx (cudawrap.cc, register.cc, RcclxScubaLogger.h) buck2 build mode/amd-gpu fbcode//comms/rcclx:rcclx-dev # tcp_devmem (batch_unpack_producer.cc, shared_region.cc) buck2 build mode/amd-gpu fbcode//comms/tcp_devmem/unpack:batch_unpack_producer buck2 build mode/amd-gpu fbcode//comms/tcp_devmem/common:common # gloo (cuda_collectives_native.h) buck2 build mode/amd-gpu fbcode//gloo:gloo_gpu_hip ``` All targets build successfully. The BUCK dep fixes for `comms/tcp_devmem/nccl` (nccl-gen, nccl-sim) and `comms/tcp_devmem/unpack` resolve link-time errors that surface when building under ROCm constraints. Reviewed By: bbeckca Differential Revision: D93759269
This PR needs a
|
|
@pytorchbot merge |
Merge failedReason: This PR has internal changes and must be landed via Phabricator! Please try reimporting/rexporting the PR! Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
c7e1dd0 to
e703e96
Compare
…comms, gloo, caffe2 (#176671) Summary: ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: buck2 build mode/amd-gpu -m rocm72 fbcode//comms/tcp_devmem/unpack:batch_unpack_producer fbcode//gloo:cuda_collectives_native — builds successfully Differential Revision: D93759269 Pulled By: gyllstromk
…omms, gloo, caffe2 (pytorch#176671) Summary: ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Pull Request resolved: pytorch#176671 Test Plan: buck2 build mode/amd-gpu -m rocm72 fbcode//comms/tcp_devmem/unpack:batch_unpack_producer fbcode//gloo:cuda_collectives_native — builds successfully Differential Revision: D93759269 Pulled By: gyllstromk
e703e96 to
8b6c670
Compare
|
@pytorchbot drci |
|
@ptyorchbot merge |
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: trunk / linux-jammy-rocm-py3.10 / test (default, 4, 6, linux.rocm.gpu.gfx950.1), trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 3, 5, lf.linux.g6.4xlarge.experimental.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…omms, gloo, caffe2 (pytorch#176671) (pytorch#176671) Summary: ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: buck2 build mode/amd-gpu -m rocm72 fbcode//comms/tcp_devmem/unpack:batch_unpack_producer fbcode//gloo:cuda_collectives_native — builds successfully Differential Revision: D93759269 Pulled By: gyllstromk Pull Request resolved: pytorch#176671 Approved by: https://github.com/Skylion007
…omms, gloo, caffe2 (pytorch#176671) (pytorch#176671) Summary: ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy, hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree, hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with [[nodiscard]]. Combined with -Werror, this causes build failures wherever return values are discarded. Originally discovered building with ROCm 7.2 headers, but confirmed to also affect ROCm 7.0 builds (reported independently by yvliu and hqguo). The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP headers — the fix is the same for both versions. Changes: - Add (void) casts to suppress [[nodiscard]] warnings across comms/ (tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files - Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client with common:common) and comms/tcp_devmem/unpack (explicit glog dep path) that surface when building these targets under ROCm constraints The (void) casts are no-ops on CUDA and older ROCm — safe to land regardless of ROCm version. Test Plan: buck2 build mode/amd-gpu -m rocm72 fbcode//comms/tcp_devmem/unpack:batch_unpack_producer fbcode//gloo:cuda_collectives_native — builds successfully Differential Revision: D93759269 Pulled By: gyllstromk Pull Request resolved: pytorch#176671 Approved by: https://github.com/Skylion007
Summary:
ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy,
hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree,
hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with
[[nodiscard]]. Combined with -Werror, this causes build failures wherever
return values are discarded.
Originally discovered building with ROCm 7.2 headers, but confirmed to
also affect ROCm 7.0 builds (reported independently by yvliu and hqguo).
The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP
headers — the fix is the same for both versions.
Changes:
(tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files
with common:common) and comms/tcp_devmem/unpack (explicit glog dep path)
that surface when building these targets under ROCm constraints
The (void) casts are no-ops on CUDA and older ROCm — safe to land
regardless of ROCm version.
Test Plan: buck2 build mode/amd-gpu -m rocm72 fbcode//comms/tcp_devmem/unpack:batch_unpack_producer fbcode//gloo:cuda_collectives_native — builds successfully
Differential Revision: D93759269
Pulled By: gyllstromk
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang