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

[Bug] fix RayActorOptionSpec.items.spec.serveConfig.deployments.rayActorOptions.memory int32 data type #1212

Closed
1 of 2 tasks
TsykunovDmitriy opened this issue Jun 30, 2023 · 3 comments · Fixed by #1220
Closed
1 of 2 tasks
Assignees
Labels
bug Something isn't working

Comments

@TsykunovDmitriy
Copy link

TsykunovDmitriy commented Jun 30, 2023

Search before asking

  • I searched the issues and found no similar issues.

KubeRay Component

ray-operator

What happened + What you expected to happen

  1. Amount of serve deployment's memory expected in bytes. Data type for memory expected in int32 for RayActorOptionSpec.items.spec.serveConfig.deployments.rayActorOptions.memory (link to source code). In my case, I cannot specify amount of memory equal to 3.5Gb (logs from kuberay-operator in 3 section).
  2. Expected behavior - kuberay-operator supports uint64 data type (or int64).
  3. Logs from kuberay-operator:
W0628 20:13:46.926544       1 reflector.go:324] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1alpha1.RayService: json: cannot unmarshal number 3758096384 into Go struct field RayActorOptionSpec.items.spec.serveConfig.deployments.rayActorOptions.memory of type int32
E0628 20:13:46.926578       1 reflector.go:138] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1alpha1.RayService: failed to list *v1alpha1.RayService: json: cannot unmarshal number 3758096384 into Go struct field RayActorOptionSpec.items.spec.serveConfig.deployments.rayActorOptions.memory of type int32

Reproduction script

Just create random serve deployment with memory requests over than 2Gb. In my case next deployment raise error from above log.

from ray import serve

@serve.deployment(
    ray_actor_options={"memory": 3.5 * 1024 * 1024 * 1024}
)
class DummyApp:
    pass

app = DummyApp.bind()

Anything else

Thread in ray slack.
Ping: @kevin85421

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@TsykunovDmitriy TsykunovDmitriy added the bug Something isn't working label Jun 30, 2023
@kevin85421 kevin85421 self-assigned this Jul 3, 2023
@kevin85421
Copy link
Member

I found something interesting: the memory field in the Ray Serve schema is specified as type float, and it is measured in bytes. Let me figure this out.

https://sourcegraph.com/github.com/ray-project/ray@ac2230f/-/blob/python/ray/serve/schema.py?L43-L49

@kevin85421
Copy link
Member

kevin85421 commented Jul 5, 2023

[Update]

I found something interesting: the memory field in the Ray Serve schema is specified as type float, and it is measured in bytes.

The memory field is used to specify logical memory rather than physical memory. That is why it is of type float. It is very confusing.

I have already opened a PR #1220 to fix this issue. However, if you are comfortable with the nightly KubeRay, I will strongly recommend you use serveConfigV2 rather than serveConfig. serveConfig will be deprecated in the future. You can specify more than 2GB in serveConfigV2 without #1220.

@TsykunovDmitriy
Copy link
Author

With serveConfigV2 it works as expected. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants