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] Consistent parsing of custom accelerator resources #2464

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

mounchin
Copy link
Contributor

Why are these changes needed?

  • Consistent parsing of custom accelerator resources and adding them to ray start params, by sorting the resource limits.
  • This makes sure that the first custom accelerator resource gets picked up from the resource limits
  • Also fixes a flaky test case.

Related issue number

Address comment: #2425 (comment)

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@mounchin mounchin marked this pull request as ready for review October 22, 2024 16:59
@@ -809,7 +813,7 @@ func addWellKnownAcceleratorResources(rayStartParams map[string]string, resource
if !isCustomAcceleratorResourceAdded {
if rayResourceName, ok := customAcceleratorToRayResourceMap[resourceKeyString]; ok && !resourceValue.IsZero() {
if _, exists := resourcesMap[rayResourceName]; !exists {
resourcesMap[rayResourceName] = float64(resourceValue.Value())
resourcesMap[rayResourceName] = resourceValue.AsApproximateFloat64()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why change this to AsApproximateFloat64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To address this comment: #2425 (comment)

@andrewsykim andrewsykim merged commit a56b091 into ray-project:master Oct 23, 2024
26 of 27 checks passed
@mounchin mounchin deleted the mounchin/fixTestCase branch October 23, 2024 20:50
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