Accept Memory as IEC format for job submission#35
Closed
juztas wants to merge 2 commits intodoe-iri:mainfrom
Closed
Accept Memory as IEC format for job submission#35juztas wants to merge 2 commits intodoe-iri:mainfrom
juztas wants to merge 2 commits intodoe-iri:mainfrom
Conversation
This changes memory from bytes to IEC format: 512MiB, 1GiB, 4GiB for client input. Backends will continue to receive this as bytes.
gabor-lbl
reviewed
Feb 11, 2026
| gpu_cores_per_process: Annotated[int | None, Field(ge=1, description="Number of GPU cores to allocate per process")] = None | ||
| exclusive_node_use: Annotated[StrictBool, Field(description="Whether to request exclusive use of allocated nodes")] = True | ||
| memory: Annotated[int | None, Field(ge=1, description="Amount of memory to allocate in bytes")] = None | ||
| memory: Annotated[str | None, Field(min_length=4, pattern=r"^[1-9]\d*(MiB|GiB)$", examples=["1GiB", "512MiB", "64GiB"], description="Amount of memory to allocate in IEC binary format (e.g. '512MiB', '4GiB')")] = None |
Contributor
There was a problem hiding this comment.
Some thoughts:
- should we also add larger memory units (Tib, etc) for "future-proofing"?
- should we use an object here to explicitly represent things:
{ value=100, unit="Gib" }(whereunitis anenum)? - what usecase does this code help? Sure, people can now send
256Gibbut if you need to work with these values, you'll need encode/decode type code when sending/receiving the values. Not a strong opinion, but it's worth thinking about.
Contributor
Author
|
On second thought, based on your comment and looking at the psij codebase, I am inclined towards not providing this functionality at all. There is a thing that machines expect, and what humans want to see. It would simply overcomplicate transformation (from_bytes, to_bytes), similarly, forcing backend/automated tools to do this transformation also. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes memory from bytes to IEC format: 512MiB, 1GiB, 4GiB for client input. Backends will continue to receive this as bytes.