feat(FR-2867): add unified memory accelerator UX in Resource Allocation#7360
feat(FR-2867): add unified memory accelerator UX in Resource Allocation#7360yomybaby wants to merge 1 commit into
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
193c1c8 to
4677880
Compare
There was a problem hiding this comment.
Pull request overview
Adds unified-memory accelerator UX to the Session Launcher’s Resource Allocation step by detecting accelerator slot names ending in .unified and enforcing “accelerator memory mirrors host memory” behavior with a localized info note.
Changes:
- Added unified-slot detection and unit conversion helpers, and updated Resource Allocation handlers to sync accelerator memory from
memand disable direct edits in unified mode. - Added unit tests for
.unifiedslot-name detection. - Added an i18n string for the unified-memory info note (English).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
react/src/components/SessionFormItems/ResourceAllocationFormItems.tsx |
Adds unified-slot detection/conversion helpers; disables accelerator slider/input in unified mode; syncs accelerator value from mem via event handlers; shows i18n note. |
react/src/components/SessionFormItems/ResourceAllocationFormItems.test.ts |
Adds tests for isUnifiedAcceleratorSlot behavior. |
resources/i18n/en.json |
Adds session.launcher.UnifiedAcceleratorMemoryNote English string. |
4677880 to
05f03c6
Compare
05f03c6 to
25d47b1
Compare

Resolves #7358(FR-2867)
Summary
Adds Resource Allocation UX for unified memory architecture accelerator slots (slot name suffix
.unified, e.g.cuda.unified) in the Session Launcher.When the selected accelerator slot is
.unified:mem) slider, converted into the slot's reporteddisplay_unit(falls back to GiB when the unit is not available).For regular discrete accelerator slots (no
.unifiedsuffix), behavior is unchanged.Identification keys off the slot-name suffix only, so the convention generalizes beyond
cuda.unifiedto any future unified-memory accelerator family.Approach
The first revision used a
useEffectwatchingmemand writing to['resource', 'accelerator']. Review feedback pointed out two problems with that shape: ordering races against preset/image effects, and a submit-time lag risk. This revision drops the watcher effect in favor of event-driven writes:memonChangefires and the active accelerator slot is.unified, the accelerator value is written in the same callback.onChangefires:.unifiedslot writes the currentmem-derived value.acceleratorto that slot'smin(no stale GiB number left behind).Form.Itemalready lists['resource', 'mem']independencies, so the field re-renders whenmemchanges;disabledis true while.unified.There is no parallel state to keep in lockstep — the form value is the single source of truth, written once at the moment either input changes.
The slot's
display_unit(e.g.GiB,MiB,TiB) is mapped to the binary-size prefix consumed byconvertToBinaryUnit. Ifdisplay_unitis missing or unrecognized, the value falls back to GiB.Changes
react/src/components/SessionFormItems/ResourceAllocationFormItems.tsxisUnifiedAcceleratorSlot(slotName).displayUnitToInputSizeUnitandgetUnifiedAcceleratorValueFromMem.memInputNumberonChangeand accelerator-typeBAISelectonChange.Form.Itemextrainfo note when.unifiedis selected; slider/inputdisabledin that mode.react/src/components/SessionFormItems/ResourceAllocationFormItems.test.tsisUnifiedAcceleratorSlot(matches.unified, rejects discrete includingcuda.mem, handles nullish).resources/i18n/en.jsonsession.launcher.UnifiedAcceleratorMemoryNote(English source; translations follow via the i18n pass).Verification Results
mainin 9 unrelated files are not introduced by this PR.react/).Out of scope (separate follow-up)
.unifiedslots — tracked in FR-2868. Surfaces such asResourceNumber.tsx,ResourcePresetSelect.tsx,ResourcePresetList.tsx,MyResource.tsx, and session/service detail displays still render accelerator memory independently for unified slots; folding those into a single combined display is out of scope here..unifiedis selected.Test plan
.unifiedaccelerator type in Session Launcher → accelerator-memory slider is disableddisplay_unit.unifiedaccelerator and verifyacceleratorvalue equalsmem(in the slot's unit)