Fix integer overflow in activitiesMaxGpuBufferSize for values >= 2048 MB#1316
Open
anubhavchaturvedi wants to merge 1 commit intopytorch:mainfrom
Open
Fix integer overflow in activitiesMaxGpuBufferSize for values >= 2048 MB#1316anubhavchaturvedi wants to merge 1 commit intopytorch:mainfrom
anubhavchaturvedi wants to merge 1 commit intopytorch:mainfrom
Conversation
Summary: Fix integer overflow that occurs when `ACTIVITIES_MAX_GPU_BUFFER_SIZE_MB` is set to 2048 MB or higher, which was causing GPU trace collection to fail silently with negative buffer sizes. Change `activitiesMaxGpuBufferSize_` and related APIs from `int` to `int64_t` throughout the codebase to prevent overflow when multiplying megabytes by 1024*1024. The overflow occurred because `2048 * 1024 * 1024 = 2^31`, which exceeds the signed 32-bit integer maximum, resulting in a negative value that immediately terminated GPU profiling during warmup. --- AI generated Summary & Test Plan from DEV117610005 Differential Revision: D97185175
|
@anubhavchaturvedi has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97185175. |
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:
Fix integer overflow that occurs when
ACTIVITIES_MAX_GPU_BUFFER_SIZE_MBis set to 2048 MB or higher, which was causing GPU trace collection to fail silently with negative buffer sizes.Change
activitiesMaxGpuBufferSize_and related APIs frominttoint64_tthroughout the codebase to prevent overflow when multiplying megabytes by 1024*1024. The overflow occurred because2048 * 1024 * 1024 = 2^31, which exceeds the signed 32-bit integer maximum, resulting in a negative value that immediately terminated GPU profiling during warmup.AI generated Summary & Test Plan from DEV117610005
Differential Revision: D97185175