Skip to content

Accept Memory as IEC format for job submission#35

Closed
juztas wants to merge 2 commits intodoe-iri:mainfrom
juztas:iecmem
Closed

Accept Memory as IEC format for job submission#35
juztas wants to merge 2 commits intodoe-iri:mainfrom
juztas:iecmem

Conversation

@juztas
Copy link
Contributor

@juztas juztas commented Feb 11, 2026

This changes memory from bytes to IEC format: 512MiB, 1GiB, 4GiB for client input. Backends will continue to receive this as bytes.

This changes memory from bytes to IEC format: 512MiB, 1GiB, 4GiB for client input. Backends will continue to receive this as bytes.
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
Copy link
Contributor

Choose a reason for hiding this comment

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

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" } (where unit is an enum)?
  • what usecase does this code help? Sure, people can now send 256Gib but 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.

@juztas
Copy link
Contributor Author

juztas commented Feb 12, 2026

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.
I am closing this for now (feel free to re-open if you think we should have this and will be happy to provide a pull request).

@juztas juztas closed this Feb 12, 2026
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