Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change MAX_MEMORY_BANDWIDTH device query to uint64 #2653

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

omarahmed1111
Copy link
Contributor

@omarahmed1111 omarahmed1111 commented Jan 31, 2025

The max value that could be assigned to MemoryBandwidth variable is (250 * 3200000 * 256) which will overflow the uint32 max capacity. so we should change that to be uint64 to fit the maximum value from this computation.

@omarahmed1111 omarahmed1111 requested a review from a team as a code owner January 31, 2025 17:40
@github-actions github-actions bot added the cuda CUDA adapter specific issues label Jan 31, 2025
Copy link
Contributor

@jchlanda jchlanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

source/adapters/cuda/device.cpp Outdated Show resolved Hide resolved
@omarahmed1111 omarahmed1111 force-pushed the change-MAX_MEMORY_BANDWIDTH-device-query-to-int64 branch 3 times, most recently from f3775e3 to 3c22a26 Compare February 3, 2025 13:28
@omarahmed1111 omarahmed1111 requested a review from a team as a code owner February 3, 2025 13:28
@omarahmed1111 omarahmed1111 force-pushed the change-MAX_MEMORY_BANDWIDTH-device-query-to-int64 branch from 3c22a26 to 8922e51 Compare February 3, 2025 13:28
@github-actions github-actions bot added conformance Conformance test suite issues. specification Changes or additions to the specification labels Feb 3, 2025
@omarahmed1111 omarahmed1111 changed the title [CUDA] Change MAX_MEMORY_BANDWIDTH device query to uint64 Change MAX_MEMORY_BANDWIDTH device query to uint64 Feb 3, 2025
scripts/core/device.yml Outdated Show resolved Hide resolved
@omarahmed1111 omarahmed1111 force-pushed the change-MAX_MEMORY_BANDWIDTH-device-query-to-int64 branch 2 times, most recently from 7a156bd to 35c8baa Compare February 6, 2025 13:17
@omarahmed1111 omarahmed1111 added the ready to merge Added to PR's which are ready to merge label Feb 6, 2025

uint32_t MemoryBandwidth = MemoryClockKHz * MemoryBusWidth * 250;
uint64_t MemoryBandwidth =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is bits per second, don't we need to multiply by 1000 to account for the kHz aspect?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also where does the MemoryBandwidthConstant come from? I know it was already there, but have providence comments for magic numbers would be useful.

Also, since it's putatively a constant: const or constexpr, please

Copy link
Contributor Author

@omarahmed1111 omarahmed1111 Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original equation is meant to use it as KHz to get it as b/s. I added a comment explaining how to get this constant from in the nvidia doc page. Do you think that should be enough or should I write the computation constants also in a comment?

@omarahmed1111 omarahmed1111 removed the ready to merge Added to PR's which are ready to merge label Feb 7, 2025
@omarahmed1111 omarahmed1111 force-pushed the change-MAX_MEMORY_BANDWIDTH-device-query-to-int64 branch from 35c8baa to 807196a Compare February 10, 2025 12:32
@omarahmed1111 omarahmed1111 added the ready to merge Added to PR's which are ready to merge label Feb 10, 2025
@omarahmed1111 omarahmed1111 force-pushed the change-MAX_MEMORY_BANDWIDTH-device-query-to-int64 branch from 807196a to 804e82d Compare February 11, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conformance Conformance test suite issues. cuda CUDA adapter specific issues ready to merge Added to PR's which are ready to merge specification Changes or additions to the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants