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

Fix for duty cycle metrics out of range issue #438

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

grac3gao
Copy link
Member

@grac3gao grac3gao commented Feb 11, 2025

We found duty cycle metrics returns out of range [0-100] value, this fix is for resolving this. It also adds more logs and comments for future diagnosis.

Manually tested.

return uint(util), nil
averageUtilization := uint(util)
if averageUtilization > 100 || averageUtilization < 0 {
return 0, fmt.Errorf("failed to get GPU utilization for device %s, out of range [0, 100] utilization: %d, sum: %d, sampleCount: %d", uuid, averageUtilization, uint(sum), uint(sampleCount))
Copy link
Contributor

Choose a reason for hiding this comment

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

How will the error be handled from the function calller?

Copy link
Member Author

Choose a reason for hiding this comment

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

@grac3gao grac3gao merged commit 8744994 into GoogleCloudPlatform:master Feb 14, 2025
2 checks passed
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