qwen3_5_moe: guard new cudaMemGetInfo blocks behind EXECUTORCH_BUILD_CUDA#19265
Merged
rascani merged 1 commit intopytorch:mainfrom May 1, 2026
Merged
qwen3_5_moe: guard new cudaMemGetInfo blocks behind EXECUTORCH_BUILD_CUDA#19265rascani merged 1 commit intopytorch:mainfrom
rascani merged 1 commit intopytorch:mainfrom
Conversation
…CUDA pytorch#19228 added structured GPU memory tracking to the qwen3_5_moe runner but did not wrap the new cudaMemGetInfo blocks in the existing EXECUTORCH_BUILD_CUDA guard that the rest of the file uses for CUDA-only APIs. The same main.cpp is built for the Metal target where the CUDA runtime headers are not available, so the new blocks failed to compile on macOS: error: use of undeclared identifier 'cudaMemGetInfo' if (cudaMemGetInfo(&free, &total) == cudaSuccess) { Wrap the three new scoped blocks in #ifdef EXECUTORCH_BUILD_CUDA, matching the existing guard pattern at lines 27, 68, 113, 168, and 184. The stats struct fields they would have populated (gpu_free_before_load_bytes, gpu_free_after_load_bytes, gpu_free_after_generate_bytes, gpu_peak_usage_mb) default to their sentinel values on non-CUDA builds, so the rest of the runner's stats reporting tolerates their absence. Authored with Claude Code.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19265
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled Job, 14 Pending, 4 Unrelated FailuresAs of commit da9af5b with merge base a7e44bf ( NEW FAILURE - The following job has failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Gasoonjia
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#19228 added structured GPU memory tracking to the qwen3_5_moe runner but did not wrap the new cudaMemGetInfo blocks in the existing EXECUTORCH_BUILD_CUDA guard that the rest of the file uses for CUDA-only APIs. The same main.cpp is built for the Metal target where the CUDA runtime headers are not available, so the new blocks failed to compile on macOS:
Wrap the three new scoped blocks in #ifdef EXECUTORCH_BUILD_CUDA, matching the existing guard pattern at lines 27, 68, 113, 168, and 184. The stats struct fields they would have populated (gpu_free_before_load_bytes, gpu_free_after_load_bytes, gpu_free_after_generate_bytes, gpu_peak_usage_mb) default to their sentinel values on non-CUDA builds, so the rest of the runner's stats reporting tolerates their absence.
Authored with Claude Code.
Test plan
CI