-
Notifications
You must be signed in to change notification settings - Fork 515
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
Ajay tripathy fix gpucost #2523
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -279,7 +279,7 @@ func (c *CSVProvider) NodePricing(key models.Key) (*models.Node, models.PricingM | |||
} | |||
} | |||
totalCost := hourly * float64(count) | |||
node.GPUCost = fmt.Sprintf("%f", totalCost) | |||
node.GPUCost = fmt.Sprintf("%f", hourly) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this has to be modified, doesn't the line a little below
node.Cost = fmt.Sprintf("%f", nc+totalCost)
have to be modified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't understand why this isn't totalCost
-- if there are multiple GPUs, shouldn't the cost be multiplied? Or is this because GPUClassPricing
contains prices that total the GPUs on a node, rather than breaking them out individually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't think so. node.GPUCost is unit cost of a GPU; node.Cost is totalCost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the field that gets transformed into node_gpu_hourly_cost . Its sister queries are node_cpu_hourly_cost and node_ram_hourly_cost which are unit prices per 1cpu and 1GB RAM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't think so. node.GPUCost is unit cost of a GPU; node.Cost is totalCost
Oh, huh, that's a little confusing; sorry I think I thought we were in a different part of the Opencost codebase. Now that I see we're in provider land, this makes more sense.
This is the field that gets transformed into node_gpu_hourly_cost . Its sister queries are node_cpu_hourly_cost and node_ram_hourly_cost which are unit prices per 1cpu and 1GB RAM.
Perfect, this makes way more sense now.
26479f5
to
ef1b418
Compare
Quality Gate passedIssues Measures |
What does this PR change?
Does this PR relate to any other PRs?
How will this PR impact users?
Does this PR address any GitHub or Zendesk issues?
How was this PR tested?
Does this PR require changes to documentation?
Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?