Skip to content

Fix restore sequence order - #5

Open
Edwinhr716 wants to merge 1 commit into
gpu-os:mainfrom
Edwinhr716:patch-kubernetes-example
Open

Fix restore sequence order#5
Edwinhr716 wants to merge 1 commit into
gpu-os:mainfrom
Edwinhr716:patch-kubernetes-example

Conversation

@Edwinhr716

@Edwinhr716 Edwinhr716 commented Jul 27, 2026

Copy link
Copy Markdown

When cuda-checkpoint attempted to restore the driver state, it encountered virtual addresses that had no physical memory mapped to them (since they were released during checkpoint). The driver state restore would fail because the underlying VMM (Virtual Memory Management) allocations and handles did not exist yet.

The patch reverses this order:
• Step 1: Signal the application to run its internal restore first. The application allocates new physical memory and remaps its virtual addresses
to it (via cuMemCreate and cuMemMap).
• Step 2: Call cuda-checkpoint --toggle to restore the CUDA driver state.
By remapping the physical memory first, the application presents a valid memory layout when cuda-checkpoint runs. The driver-level restore then succeeds because it finds the expected memory mappings and handles already re-established.

@Edwinhr716 Edwinhr716 changed the title patch for kubernetes example Fix restore sequence order Jul 27, 2026
Edwinhr716 added a commit to llm-d-incubation/llm-d-rl-time-slicing that referenced this pull request Aug 18, 2026
Pristine copy of https://github.com/gpu-os/GPU-CR at commit
e9bbb52e1f52986587fc631217c0f2b50b46245a (upstream HEAD as of 2026-08),
plus a provenance README (README.llm-d.md). No upstream file is modified;
nothing is wired into this repo's build or CI.

Upstream is an experimental research project with limited maintenance
(our upstream PR, gpu-os/GPU-CR#5, is unreviewed),
so we carry a best-effort fork per Kubernetes-ecosystem practice
(kubernetes/kubernetes third_party/forked/, kubernetes/klog <- golang/glog,
kube-openapi pkg/validation <- go-openapi).

third_party/gpu-cr is excluded from cosmetic linters; functional CI
applies in full.

To verify the import is pristine:
  git clone https://github.com/gpu-os/GPU-CR /tmp/gpu-cr-upstream
  git -C /tmp/gpu-cr-upstream checkout e9bbb52e1f52986587fc631217c0f2b50b46245a
  diff -r --exclude=.git /tmp/gpu-cr-upstream third_party/gpu-cr
  # only difference: the added README.llm-d.md

Signed-off-by: Edwinhr716 <edandres249@gmail.com>
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.

1 participant