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

Make the shared memory setting for new sessions more intuitive #1726

Open
3 tasks done
achimnol opened this issue Nov 21, 2023 · 1 comment · May be fixed by #1770
Open
3 tasks done

Make the shared memory setting for new sessions more intuitive #1726

achimnol opened this issue Nov 21, 2023 · 1 comment · May be fixed by #1770
Assignees
Labels
comp:manager Related to Manager component effort:easy Need to understand only a specific region of codes (good first issue, easy). type:enhance Enhance component, behavior, internals without user-facing features urgency:4 As soon as feasible, implementation is essential.
Milestone

Comments

@achimnol
Copy link
Member

achimnol commented Nov 21, 2023

This is a late follow-up to lablup/backend.ai-webui#314.

Currently, the image label ai.backend.resource.min.mem is interpreted as the main memory size, excluding the shared memory size.
However, the web UI's resource configuration automatically sets the shared memory size ($S$) to 64 MiB for the main memory sizes ($M$) less than 4 GiB, while our scheduler allocates the sum of the main memory size and the shared memory size ($M+S$).

This makes a confusion when allocating the least amount of memory $M+S = 256\ \mathrm{MiB}$, for instance, because it epic-fails as the web UI sends $M = 192\ \mathrm{MiB}$ and $S = 64\ \mathrm{MiB}$, while the manager's enqueue-session API handler compares the image label ai.backend.resource.min.mem with $M$ only and requires $M \ge 256\ \mathrm{MiB}$.

We are going to update the web UI to hide the detailed shared memory configuration for most use cases, and the memory resource slider will expose $M+S$ with auto-configured $S$ depending on the value of $M + S$.

To better support the above web UI update, let's change the enqueue-session API handler to:

  • Compare ai.backend.resource.min.mem with $M+S$ instead of $M$.
  • Raise an explicit input validation error if $S > M$, to prevent situations like $M = 0$ wihle $S = 1\ \mathrm{GiB}$.

The Client SDK and CLI should still expose the raw configurations as the options. So, let's:

  • Update the CLI's help texts to be explicitly consistent with the above changes.
@achimnol achimnol added comp:manager Related to Manager component effort:easy Need to understand only a specific region of codes (good first issue, easy). type:enhance Enhance component, behavior, internals without user-facing features urgency:4 As soon as feasible, implementation is essential. labels Nov 21, 2023
@achimnol achimnol added this to the 24.03 milestone Nov 21, 2023
@fregataa
Copy link
Member

fregataa commented Dec 8, 2023

The current implementation takes either of the specified shmem or the minimum shmem value required by image and adds it to the minimum mem value required by image, and compares it to the user-specified mem value.
In other words, it compares (S or ai.backend.resource.min.shmem) + ai.backend.resource.min.mem to M . Are we going to change this behavior to check ai.backend.resource.min.mem < M + S?
And how should we handle the case of max resource slot? Should it be ai.backend.resource.max.mem > M + S ?

@fregataa fregataa linked a pull request Dec 8, 2023 that will close this issue
3 tasks
@achimnol achimnol modified the milestones: 24.03, 24.12 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component effort:easy Need to understand only a specific region of codes (good first issue, easy). type:enhance Enhance component, behavior, internals without user-facing features urgency:4 As soon as feasible, implementation is essential.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants